Counting Occurrance of # In Range

A

AB

I have a range of #s and I want to count the first occurrence of each number.
I used CountIf but I received false results. See the example below. The
results for 300 should have been 3 for each occurrence. But I would prefer
to have 3 for the first occurrence of 300 and 0 for the 2nd and 3rd
occurrence. Help.

Column A Results
10 1
15 1
300 3
300 2
300 1
20 2
20 1
 
M

Mike H

Hi,

the range address must be absolute to get the result you want

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

Mike
 
K

Ken Johnson

I have a range of #s and I want to count the first occurrence of each number.
 I used CountIf but I received false results.  See the example below. The
results for 300 should have been 3 for each occurrence.  But I would prefer
to have 3 for the first occurrence of 300 and 0 for the 2nd and 3rd
occurrence.  Help.

Column A        Results
10      1
15      1
300     3
300     2
300     1
20      2
20      1

Try...

=COUNTIF($A$1:$A$7,A1)*IF(COUNTIF($A$1:A1,A1)>1,0,1)

Ken Johnson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top