英文:
Sheets flag duplicates when Column A and Column B exactly match another row in the column
问题
列A - 名字
列B - 姓氏
我需要表格在出现重复时进行标记(我们通过Google表单提交的同一人的重复提交)
我明白如何使列A中的重复项突出显示,但只有名字不足以作为标识符(例如,我们经常有两个名叫Joe的人,他们是不同的人,因此不是“重复项”)
我该如何编写代码来判断如果列A和列B完全匹配,就显示“重复项”?
谢谢
英文:
Column A - First Name
Column B - Last Name
I need sheets to flag when a duplicate appears (we have duplicate submissions for the same person submitted via a google form)
I understand how to make it so that if there's a duplicate in column A it will highlight, however first name is not enough of an identifier (e.g we often have two Joe's that are 2 different people therefore not 'duplicates')
How do I write something that says if Column A & B match exactly show me 'duplicate'?
Thanks
答案1
得分: 2
将这个公式放入单元格 C2
中:
=arrayformula( if( countifs(A2:A, A2:A, B2:B, B2:B) > 1, "重复", iferror(1/0) ) )
或者,可以使用此 条件格式 自定义公式规则来处理范围 A2:B
:
=countifs($A$2:$A, $A2, $B$2:$B, $B2) > 1
英文:
Put this formula in cell C2
:
=arrayformula( if( countifs(A2:A, A2:A, B2:B, B2:B) > 1, "duplicate", iferror(1/0) ) )
Alternatively, use this conditional formatting custom formula rule for the range A2:B
:
=countifs($A$2:$A, $A2, $B$2:$B, $B2) > 1
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论