Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
AB AB is offline
external usenet poster
 
Posts: 33
Default Counting Occurrance of # In Range

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Counting Occurrance of # In Range

Hi,

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

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

Mike

"AB" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default Counting Occurrance of # In Range

On Oct 7, 12:02*am, AB wrote:
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
position of second occurrance Stefi Excel Worksheet Functions 6 June 24th 08 03:58 PM
counting range saman110 via OfficeKB.com Excel Discussion (Misc queries) 3 February 15th 08 05:32 AM
Counting from one range to another range, multiple criteria macamarr Excel Discussion (Misc queries) 3 June 10th 06 11:02 AM
Counting a range Blink Excel Worksheet Functions 3 August 25th 05 04:21 PM
counting a cell range within a range mmay321 Excel Worksheet Functions 2 August 10th 05 03:56 PM


All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"