1
votes

I am attempting to exclude values my countif formula has already counted, and instead insert a value such as "Already counted".

I need to count how many times a specific item appears in a column, which I used the basic countif formula for: =COUNTIF(A:A,A2). It returned these results:

Name # of Name

Mike 2

Sally 2

John 3

Kim 2

Jose 2

Sally 2

John 3

Brenda 1

John 3

Jose 2

Kim 2

Mike 2

(Column A is the "Name", Column B is the formula column "# of Name".)

OK, great. The issue is when the second occurrence of "Sally" happens, it counts the word again. I would like to ignore it because it has already been counted, and instead insert another value, such as "Already Counted". Thank you for your help in advance.

2

2 Answers

1
votes

Use MATCH to test if first in the list:

=IF(MATCH(A2,A:A,0)=ROW(),COUNTIF(A:A,A2),"Already Counted")

enter image description here

1
votes

You can COUNTIF for the limited range ending with the current row, and, if more than 1, you know it was already counted

=IF(COUNTIF($A$2:A2,A2)=1,COUNTIF($A:$A,A2),"Already Counted")

enter image description here

EDIT: Having just seen it, I like Scott's solution also.