Google Sheets IF函数返回值

问题描述 投票:1回答:2

我在Google表格中有此ID表:

All_ID       product_id     Package ID  subpackage ID
                              65385A    65385A1
                                        65385A2
             65385            65385B    65385B1
                                        65385B2
             52002            52002A    
                              52002B    52002B1
                                        52002B2
                              52002C    
                              52002D

             60000  

如何在ALL_ID列中返回Google表格中或(与Excel相当的数字)中最“详细”的ID?

 All_ID      product_id        Package ID  subpackage ID
 65385A1                          65385A    65385A1
 65385A2                                    65385A2
 65385B1         65385            65385B    65385B1
 65385B2                                    65385B2
  52002A         52002            52002A    
 52002B1                          52002B    52002B1
 52002B2                                    52002B2
  52002C                          52002C    
  52002D                          52002D
  60000          60000  

我在两列(=IF(B1="",C1,B1)中使用了类似的功能

arrays if-statement google-sheets google-sheets-formula array-formulas
2个回答
2
投票

在第2行中使用:

=ARRAYFORMULA(IF(D2:D<>"", D2:D, 
              IF(C2:C<>"", C2:C, 
              IF(B2:B<>"", B2:B, ))))

0
投票

嗨,我认为以下的fx会为您提供帮助。

= INDEX(B2:D2; MATCH(1; SIGN(LEN(B2:D2)= MAX(LEN(B2:D2))); 0))]]] >>

© www.soinside.com 2019 - 2024. All rights reserved.