求助大佬重复值公式
excel吧
全部回复
仅看楼主
level 6
萌萌爸爸 楼主
当A列有重复值,则在B列最后一个重复值显示yes,没有重复值的在B列显示no,感谢各位大佬了
2023年03月09日 04点03分 1
level 11
Option Explicit
Sub abc()
 Dim i, d
 Set d = CreateObject("scripting.dictionary")
 For i = [a1].End(xlDown).Row To 1 Step -1
  d(Cells(i, "a").Value) = d(Cells(i, "a").Value) + 1
 Next
 For i = [a1].End(xlDown).Row To 1 Step -1
  If d(Cells(i, "a").Value) = 1 Then
   Cells(i, "b") = "no"
  ElseIf d(Cells(i, "a").Value) > 1 Then
   Cells(i, "b") = "yes"
   d(Cells(i, "a").Value) = 0
  Else
   Cells(i, "b") = Empty
  End If
 Next
End Sub
2023年03月09日 04点03分 2
level 8
2023年03月09日 06点03分 3
level 12
=IF(COUNTIF(A:A,A1)=1,"no",IF(COUNTIF(A:A,A1)=COUNTIF($A$1:A1,A1),"yes",""))
2023年03月09日 09点03分 4
1