Arrayformula比较两列并跳过空白单元格

时间:2019-01-14 18:15:11

标签: google-sheets google-sheets-formula

我在两张不同的纸上有两列,列有一长列值;我正在尝试比较这两列,以检查第一列中的条目是否存在于第二列中。在第一列中还有空白单元格。

我尝试了不同的公式,但是所有公式都返回一个空白单元格的值,而不是空白单元格。

这些是我尝试过的公式:

=arrayformula(iferror(if(match(A1:A,AnotherSheet!A1:A,0),"yes"),"no"))

=query(arrayformula(iferror(if(match(A1:A,AnotherSheet!A1:A,0),"yes"),"no")), "Select * where Col1<>''")

=query(arrayformula(iferror(if(match(A1:A,AnotherSheet!A1:A,0),"yes"),"no")), "Select * where Col1 is not empty")

第一列中的所有空白单元格都返回“ no”,我想改用空白单元格。谢谢

1 个答案:

答案 0 :(得分:0)

=ARRAYFORMULA(IF(LEN(A1:A), IFERROR(IF(MATCH(A1:A, AnotherSheet!A1:A, 0), "yes"), "no"), ))