#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Counting a list

Hi
Does anyone know how I can count numbers in a list, but only count the one's
that are different, for example, if counting the following:-
12345
12345
23569
12358
22583

I only want to show a total of 4...

Also, can this be applied to text?

thankyou
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Counting a list

How many unique items (count) ?
=SUMPRODUCT(1/COUNTIF(A1:A10,A1:A10&""))
If there are blanks in the range they count as an item
=SUMPRODUCT((A1:A10<"")/COUNTIF(A1:A10,A1:A10&""))
blanks are note included in count
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Fiona" wrote in message
...
Hi
Does anyone know how I can count numbers in a list, but only count the
one's
that are different, for example, if counting the following:-
12345
12345
23569
12358
22583

I only want to show a total of 4...

Also, can this be applied to text?

thankyou



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Counting a list

Enter this in B1
=COUNTIF(A1:$A$5,A1)
adjust $A$5 to your actual range
Copy it down
Then use
=SUMIF(B1:B5,1) to get the sum

"Fiona" wrote:

Hi
Does anyone know how I can count numbers in a list, but only count the one's
that are different, for example, if counting the following:-
12345
12345
23569
12358
22583

I only want to show a total of 4...

Also, can this be applied to text?

thankyou

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Counting a list

=SUMPRODUCT((A1:A1500<"")/COUNTIF(A1:A1500,A1:A1500&""))

--
Gary''s Student - gsnu200828


"Fiona" wrote:

Hi
Does anyone know how I can count numbers in a list, but only count the one's
that are different, for example, if counting the following:-
12345
12345
23569
12358
22583

I only want to show a total of 4...

Also, can this be applied to text?

thankyou

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Thanks!

Thanks Bernard, thats exactly what I needed


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Counting a list

Hi Bernard
I wondered if you knew if I can add another 2 conditions to this formula.

Would it be possible to count a list as detailed in your formula, but only
if coloumn B relates to a set condition and if the date is between a certain
time.

e.g

Coloumn A Coloumn B Coloumn C
1111 X 20/01/2009
1111 X 19/01/2009
1234 Y 19/01/2009
1258 Z 15/01/2009
1254 Y 14/01/2009

I want to count Coloumn A (as detailed in your formula) if Coloumn B
xontains X and Coloumn C is greter that 16/01/2009 but less that 21/01/2009.

Is that too many formulas?

Thanks

"Bernard Liengme" wrote:

How many unique items (count) ?
=SUMPRODUCT(1/COUNTIF(A1:A10,A1:A10&""))
If there are blanks in the range they count as an item
=SUMPRODUCT((A1:A10<"")/COUNTIF(A1:A10,A1:A10&""))
blanks are note included in count
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Fiona" wrote in message
...
Hi
Does anyone know how I can count numbers in a list, but only count the
one's
that are different, for example, if counting the following:-
12345
12345
23569
12358
22583

I only want to show a total of 4...

Also, can this be applied to text?

thankyou




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Counting a list

=SUMPRODUCT(--(B1:B10="X"), --(C1:C10DATE(2009,1,16),--(C1:C10<DATE(2009,1,21)
will count how may entries have X in the B column and a date In column C
that is 16/01/2009 but less that 21/01/2009.
For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.htm


However, this will count every entry that fits the criteria, not just the
unique ones. If this is required and you are prepared to add a 'helper
column', let me know and I will show you how.

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Fiona Yorke-Saville" wrote in
message ...
Hi Bernard
I wondered if you knew if I can add another 2 conditions to this formula.

Would it be possible to count a list as detailed in your formula, but only
if coloumn B relates to a set condition and if the date is between a
certain
time.

e.g

Coloumn A Coloumn B Coloumn C
1111 X 20/01/2009
1111 X 19/01/2009
1234 Y 19/01/2009
1258 Z 15/01/2009
1254 Y 14/01/2009

I want to count Coloumn A (as detailed in your formula) if Coloumn B
xontains X and Coloumn C is greter that 16/01/2009 but less that
21/01/2009.

Is that too many formulas?

Thanks

"Bernard Liengme" wrote:

How many unique items (count) ?
=SUMPRODUCT(1/COUNTIF(A1:A10,A1:A10&""))
If there are blanks in the range they count as an item
=SUMPRODUCT((A1:A10<"")/COUNTIF(A1:A10,A1:A10&""))
blanks are note included in count
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Fiona" wrote in message
...
Hi
Does anyone know how I can count numbers in a list, but only count the
one's
that are different, for example, if counting the following:-
12345
12345
23569
12358
22583

I only want to show a total of 4...

Also, can this be applied to text?

thankyou






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
Counting from list entries rotors Excel Discussion (Misc queries) 2 March 28th 07 01:09 AM
counting names only once in a list philmail Excel Worksheet Functions 5 February 19th 07 02:23 PM
Counting a Filtered List kkrebs Excel Discussion (Misc queries) 6 September 22nd 05 02:57 PM
Counting what's left in a list WBTKbeezy Excel Worksheet Functions 2 August 3rd 05 04:34 PM
Counting a list Ben Blair Excel Worksheet Functions 0 May 26th 05 02:51 AM


All times are GMT +1. The time now is 09:12 PM.

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"