Counting Occurrance of # In Range

  • Thread starter Thread starter AB
  • Start date Start date
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
 
Hi,

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

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

Mike
 
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
 
Back
Top