How to get unique values in a column using excel formula

前端 未结 3 1144
时光说笑
时光说笑 2021-02-18 23:15

I have Excel Data like below

       JID     Val

       1001    22
       1030    6
       1031    14          
       1041    8
       1001    3
       2344             


        
3条回答
  •  遇见更好的自我
    2021-02-18 23:36

    I think I've found a more elegant workaround without array-functions or built-in functions:

    • 1st column (ID):
      this is the array from we'd like to select distinct values

    • 2nd column (criteria): checks whether this is the first occurrence
      =IF((ROW()-1)=MATCH(A2,$A$2:$A$500,0),1,0)

    • 3rd column (cumulative):
      =SUM($B$2:B2)

    • 4th column (count):
      this is constant 1

    • 5th column (unique ID):
      =OFFSET($A$2,MATCH(ROW()-1,$C$2:$C$501,0)-1,)

    • 6th column (count):
      =SUMIF(A2:A21,F2,D2:D21)

提交回复
热议问题