Excel B 列有重复项,对于 B 中的每组重复项,A 列中只有 1 行有值,return 可以确定是否匹配
Excel Column B has duplicates and only 1 row has value in Column A for each set of duplicates in B, return something to identify there is a match
Excel公式(非VBA首选)
B 列有重复项,对于 B 列中的每组重复项,只有 1 行在 A 列中具有值。
需要在 C 列中 return "something"/True/False/wtvr 来确定 A 和 B 中的任何地方都有一个值,用于 B 列中的重复值,将 A 列中没有任何内容的项目留空。
使用起来相当简单 COUNTIFS
:
=IF(COUNTIFS(B:B,B2,A:A,"<>")>0,"something","")
如果 A 列包含 returns 空字符串 (""
) 的公式,类似于:
=IF(SUMPRODUCT((B:B=B2)*(LEN(A:A)>0))>0,"something","")
其中 B:B
和 A:A
表示数据范围。
Excel公式(非VBA首选) B 列有重复项,对于 B 列中的每组重复项,只有 1 行在 A 列中具有值。 需要在 C 列中 return "something"/True/False/wtvr 来确定 A 和 B 中的任何地方都有一个值,用于 B 列中的重复值,将 A 列中没有任何内容的项目留空。
使用起来相当简单 COUNTIFS
:
=IF(COUNTIFS(B:B,B2,A:A,"<>")>0,"something","")
如果 A 列包含 returns 空字符串 (""
) 的公式,类似于:
=IF(SUMPRODUCT((B:B=B2)*(LEN(A:A)>0))>0,"something","")
其中 B:B
和 A:A
表示数据范围。