Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 76
Default Counting independent items in a list

This formula is meant to count independent entries in A1:A20.
=ROUND(SUMPRODUCT(1/COUNTIF(A1:A20,A1:A20)),0)

Can anyone make this better? I am not talking about using Absolute
references, but ways to modify it so it works in every case. For instance,
at first I had an empty cell in my range and the #DIV/0 error was returned.
I don't fully understand the two negatives in front of some formulas, but I
am wondering if that would work better, too?
=ROUND(SUMPRODUCT(1/--COUNTIF(A1:A20,A1:A20)),0)

Thanks for any help.
-- Brad E.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Counting independent items in a list

Hi,

here's an alternative that ignores blanks

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

the double unary (--) coerce true or false into one or zero but do nothing
in your formula.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Brad E." wrote:

This formula is meant to count independent entries in A1:A20.
=ROUND(SUMPRODUCT(1/COUNTIF(A1:A20,A1:A20)),0)

Can anyone make this better? I am not talking about using Absolute
references, but ways to modify it so it works in every case. For instance,
at first I had an empty cell in my range and the #DIV/0 error was returned.
I don't fully understand the two negatives in front of some formulas, but I
am wondering if that would work better, too?
=ROUND(SUMPRODUCT(1/--COUNTIF(A1:A20,A1:A20)),0)

Thanks for any help.
-- Brad E.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Counting independent items in a list

Hi,

I should have added there are other (better) ways to do this and Bernd P has
a well presented web page on how it should be done

http://www.sulprobil.com/html/count_unique.html

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Brad E." wrote:

This formula is meant to count independent entries in A1:A20.
=ROUND(SUMPRODUCT(1/COUNTIF(A1:A20,A1:A20)),0)

Can anyone make this better? I am not talking about using Absolute
references, but ways to modify it so it works in every case. For instance,
at first I had an empty cell in my range and the #DIV/0 error was returned.
I don't fully understand the two negatives in front of some formulas, but I
am wondering if that would work better, too?
=ROUND(SUMPRODUCT(1/--COUNTIF(A1:A20,A1:A20)),0)

Thanks for any help.
-- Brad E.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Counting independent items in a list

This is Bernd's webpage that i was looking for where he specifically comments
on the solution I gave you

http://www.sulprobil.com/html/excel_don_ts.html
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Brad E." wrote:

This formula is meant to count independent entries in A1:A20.
=ROUND(SUMPRODUCT(1/COUNTIF(A1:A20,A1:A20)),0)

Can anyone make this better? I am not talking about using Absolute
references, but ways to modify it so it works in every case. For instance,
at first I had an empty cell in my range and the #DIV/0 error was returned.
I don't fully understand the two negatives in front of some formulas, but I
am wondering if that would work better, too?
=ROUND(SUMPRODUCT(1/--COUNTIF(A1:A20,A1:A20)),0)

Thanks for any help.
-- Brad E.

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
How to list items instead of counting them with Pivot Table coolthinking Excel Discussion (Misc queries) 2 August 25th 08 03:42 PM
Counting items in a list Matt Excel Worksheet Functions 6 December 25th 06 04:03 PM
Counting number of text items in list Tanya Excel Discussion (Misc queries) 0 November 29th 06 10:20 PM
Counting number of text items in list Becky Excel Discussion (Misc queries) 0 November 29th 06 09:56 PM
counting number of particular items in a list vikkam Excel Discussion (Misc queries) 8 July 5th 05 08:35 AM


All times are GMT +1. The time now is 03:13 AM.

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

About Us

"It's about Microsoft Excel"