使用Excel查找列中重复项的数量
我试图显示给定列中重复项的计数。我可以计算该列中有多少重复项,但我想知道该行是否是找到的第一个重复项、第二个重复项等。这是一些示例数据(已排序)以及我希望它如何显示:
1: ALPHA | 1
2: ALPHA | 2
3: DELTA | 1
4: ECHO | 1
5: ECHO | 2
6: ECHO | 3
7: HOTEL | 1
8: HOTEL | 2
它不'无论是否需要 VBA 或者可以用公式完成,我似乎都无法使其工作。
I'm trying to show the count of a duplicate within a given column. I can count how MANY duplicates there are within the column, but I want to know if this row is the first duplicate found, second, etc. Here's some sample data (sorted) and how I'd like it to appear:
1: ALPHA | 1
2: ALPHA | 2
3: DELTA | 1
4: ECHO | 1
5: ECHO | 2
6: ECHO | 3
7: HOTEL | 1
8: HOTEL | 2
It doesn't matter if VBA is needed or it can be done in a formula, I just can't seem to make it work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
给定行的“重复数”是等于当前条目的条目数,范围从列顶部到当前行。实际上,用公式比用英语说起来更容易:)
如果您的示例数据分为两列,并从
A1
开始,插入到
B8
中,然后复制所有向上。The 'duplicate number' of a given row is the number of entries equal to the current entry, in the range from the top of the column to the current row. This is actually easier to say in a formula than in English :)
If your example data is in two columns, and starts at
A1
, insertinto
B8
, and copy all the way up.您可以使用
间接
从其他公式的结果生成引用,例如You can use
indirect
to generate a reference from the results of other formulas, e.g.