计算一个值出现在列中的次数(excel)

时间:2020-12-02 23:55:16

Ok, So I have an excel file that have a column that may contain duplicate value like this

好的,我有一个excel文件,它有一个列可以包含像这样的重复值

PO NUMBER        PO COUNT
P100293490                4
P100293490
P100293490
P100293490
P100293492                2
P100293492
P100293494                3
P100293494
P100293494
P100293497                4
P100293497
P100293497
P100293497
P100293499                1
P100293490                2
P100293490
P100293492                1

童博数量计数P100293490 4 P100293490 P100293490 P100293490 P100293492 2 P100293492 P100293494 3 P100293494 P100293494 P100293497 4 P100293497 P100293497 P100293497 P100293499 1 P100293490 2 P100293490 P100293492 1

I need to count how many times it appeared on the column and place it beside the first occurrence of the word. The problem is that the PO NUMBER is not sorted so values may repeat on the lower rows of the excel. i tried everything (Lookup, Match, Countif, IF) and nothing seems to work. Please Help? Thanks in Advance

我需要数一数它在列上出现了多少次,并把它放在第一个出现的单词旁边。问题是PO号没有排序,因此值可能在excel的下一行重复。我试了所有的方法(查找、匹配、计数、IF),但似乎什么都不管用。请帮忙吗?谢谢提前

1 个解决方案

#1


1  

Assuming the data as you give it is in A1:B18 (with headers in row 1), enter this in B2:

假设你提供的数据在A1:B18中(第1行有标题),在B2中输入:

=IF(A1<>A2,MATCH(TRUE,INDEX(A2:A$1000<>A2,),)-1,"")

Copy down as required.

根据需要复制下来。

Amend the 1000 to a sufficiently higher row reference if necessary.

如果需要,将1000修改为足够高的行引用。

#1


1  

Assuming the data as you give it is in A1:B18 (with headers in row 1), enter this in B2:

假设你提供的数据在A1:B18中(第1行有标题),在B2中输入:

=IF(A1<>A2,MATCH(TRUE,INDEX(A2:A$1000<>A2,),)-1,"")

Copy down as required.

根据需要复制下来。

Amend the 1000 to a sufficiently higher row reference if necessary.

如果需要,将1000修改为足够高的行引用。