计数重复值 [英] Counting duplicate values

查看:161
本文介绍了计数重复值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



例如:


$ b $我想在excel中的列中返回重复值的次数b

 列A |列B 
12345678 |返回1
12345678 |返回2
12345678 |返回3
23456789 |返回1
23456789 |返回2
34567891 |返回1

我应该让我的例子更好,这将是重叠在一起。在我的情况下,他们不是。

 列A |列B 

12345678 |返回1
23456789 |返回1
12345678 |返回2
23456789 |返回2
34567891 |返回1
12345678 |返回3


解决方案

将其放在Cell B1中,将其复制

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

说明



COUNTIF函数计数范围内的单元格数符合您指定的单一标准。



如果您注意到我已经保持第一个范围不变,但是将$的$ code> $ A $ 1 第二范围为动态。当你复制下来,第一个范围将保持不变,公式将更新以适应最左边的一个单元格。



截图(对于两种方案)




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

解决方案

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)

这篇关于计数重复值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆