Counting duplicate values

可紊 提交于 2019-12-24 12:42:11

问题


I am trying to return the number of times a duplicate value occurs in a column in excel

For instance:

Column A  | Column B
12345678  | Return 1
12345678  | Return 2
12345678  | Return 3
23456789  | Return 1
23456789  | Return 2
34567891  | Return 1

I should have made my example better, this would be the the dupes are lumped together. In my case they are not.

Column A | Column B 

12345678 | Return 1 
23456789 | Return 1 
12345678 | Return 2 
23456789 | Return 2 
34567891 | Return 1 
12345678 | Return 3

回答1:


Put this in Cell B1 and copy it down

=COUNTIF($A$1:$A1,A1)

Explanation:

The COUNTIF function counts the number of cells within a range that meet a single criterion that you specify.

If you note that I have kept the first Range constant but affixing $'s $A$1 and kept the 2nd range as dynamic. As you copy down, the first range will remain a constant and the formula will update to accomodate the left most col A Cell.

Screenshot (For both Scenarios)



来源:https://stackoverflow.com/questions/16021609/counting-duplicate-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!