Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default Count Unique Values

I'm trying to count unique values based on muliple criteria. I tried using
the formula
=SUMPRODUCT(--(B2:B2500=B2),--(D2:D2500="HY")/COUNTIF(F2:F2500,F2:F2500)) but
when there's a blank in column "F" I get an error. Can this formula be writen
to ignore blank cells?

Thank you in advance for your help
Joe
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Count Unique Values

Try this:

=SUM(N(FREQUENCY(IF((B2:B2500="a")*(D2:D2500="HY") ,MATCH(F2:F2500&"",F2:F2500&"",0)),MATCH(F2:F2500& "",F2:F2500&"",0))0))

ctrl+shift+enter, not just enter


"Joe Gieder" wrote:

I'm trying to count unique values based on muliple criteria. I tried using
the formula
=SUMPRODUCT(--(B2:B2500=B2),--(D2:D2500="HY")/COUNTIF(F2:F2500,F2:F2500)) but
when there's a blank in column "F" I get an error. Can this formula be writen
to ignore blank cells?

Thank you in advance for your help
Joe

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Count Unique Values

That will return an incorrect result *if* column F is empty while columns B
and D meet the criteria.

Try it like this:

Array entered** :

=SUM(N(FREQUENCY(IF((B2:B2500="a")*(D2:D2500="HY") *(F2:F2500<""),MATCH(F2:F2500&"",F2:F2500&"",0)), ROW(F2:F2500)-ROW(F2)+1)0))

That also calculates about twice as fast.

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Teethless mama" wrote in message
...
Try this:

=SUM(N(FREQUENCY(IF((B2:B2500="a")*(D2:D2500="HY") ,MATCH(F2:F2500&"",F2:F2500&"",0)),MATCH(F2:F2500& "",F2:F2500&"",0))0))

ctrl+shift+enter, not just enter


"Joe Gieder" wrote:

I'm trying to count unique values based on muliple criteria. I tried
using
the formula
=SUMPRODUCT(--(B2:B2500=B2),--(D2:D2500="HY")/COUNTIF(F2:F2500,F2:F2500))
but
when there's a blank in column "F" I get an error. Can this formula be
writen
to ignore blank cells?

Thank you in advance for your help
Joe



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default Count Unique Values

I had posted a similar question but did not get a useable answer until I saw
your solution and when I tried it, it worked beautifully. Just wanted to say
that your formula helped me to find an answer that I had spent 2 days looking
for.
THANK YOU!!!!!!

"T. Valko" wrote:

That will return an incorrect result *if* column F is empty while columns B
and D meet the criteria.

Try it like this:

Array entered** :

=SUM(N(FREQUENCY(IF((B2:B2500="a")*(D2:D2500="HY") *(F2:F2500<""),MATCH(F2:F2500&"",F2:F2500&"",0)), ROW(F2:F2500)-ROW(F2)+1)0))

That also calculates about twice as fast.

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Teethless mama" wrote in message
...
Try this:

=SUM(N(FREQUENCY(IF((B2:B2500="a")*(D2:D2500="HY") ,MATCH(F2:F2500&"",F2:F2500&"",0)),MATCH(F2:F2500& "",F2:F2500&"",0))0))

ctrl+shift+enter, not just enter


"Joe Gieder" wrote:

I'm trying to count unique values based on muliple criteria. I tried
using
the formula
=SUMPRODUCT(--(B2:B2500=B2),--(D2:D2500="HY")/COUNTIF(F2:F2500,F2:F2500))
but
when there's a blank in column "F" I get an error. Can this formula be
writen
to ignore blank cells?

Thank you in advance for your help
Joe




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Count Unique Values

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Excel-User-RR" wrote in message
...
I had posted a similar question but did not get a useable answer until I
saw
your solution and when I tried it, it worked beautifully. Just wanted to
say
that your formula helped me to find an answer that I had spent 2 days
looking
for.
THANK YOU!!!!!!

"T. Valko" wrote:

That will return an incorrect result *if* column F is empty while columns
B
and D meet the criteria.

Try it like this:

Array entered** :

=SUM(N(FREQUENCY(IF((B2:B2500="a")*(D2:D2500="HY") *(F2:F2500<""),MATCH(F2:F2500&"",F2:F2500&"",0)), ROW(F2:F2500)-ROW(F2)+1)0))

That also calculates about twice as fast.

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Teethless mama" wrote in
message
...
Try this:

=SUM(N(FREQUENCY(IF((B2:B2500="a")*(D2:D2500="HY") ,MATCH(F2:F2500&"",F2:F2500&"",0)),MATCH(F2:F2500& "",F2:F2500&"",0))0))

ctrl+shift+enter, not just enter


"Joe Gieder" wrote:

I'm trying to count unique values based on muliple criteria. I tried
using
the formula
=SUMPRODUCT(--(B2:B2500=B2),--(D2:D2500="HY")/COUNTIF(F2:F2500,F2:F2500))
but
when there's a blank in column "F" I get an error. Can this formula be
writen
to ignore blank cells?

Thank you in advance for your help
Joe






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
Count of unique values Matt Excel Discussion (Misc queries) 8 January 20th 09 07:34 AM
Count Unique Values Dave Excel Worksheet Functions 5 December 4th 08 10:20 PM
count unique values, if ... Averitt Engineer[_2_] Excel Worksheet Functions 2 February 15th 07 06:41 PM
Count unique values and create list based on these values vipa2000 Excel Worksheet Functions 7 August 5th 05 01:17 AM
Count Unique Values annie Excel Worksheet Functions 1 June 9th 05 07:19 AM


All times are GMT +1. The time now is 04:49 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"