PC Review


Reply
Thread Tools Rate Thread

CountU from an array - SUMPRODUCT, SUM(IF(...)), both?

 
 
RobertH
Guest
Posts: n/a
 
      24th Oct 2006
Given the following dummy data (my real data involves hundreds of rows,

hundreds of color columns, and multiple "rank" columns):

A B C D E F G H
1 Rank Colors red yellow blue green orange
2 John High 2 Y Y
3 Paul Med 0
4 George Low 1 Y
5 Ringo Low 2 Y Y
6 Total 1 0 1 2 1


I'm trying to come up with a formula (without macros) that will
calculate the number of colors associated with a Low ranking Beatle
(result should be 2 because given the data above, there are two colors
(green and orange) associated with the two Beatles with a rank of
"Low".
Note that there are no colors associated with Paul and no Beatles
associated with Yellow.


So, SUMPRODUCT(($B$2:$B$5="Low")*($C$2:$C$5>0)) appears accurate, but
won't give me the right answer for "High" Beatles because it is
essentially a row count where colors > 0 for a given Rank.
I would expect the following values:


Rank Colors
High 2
Med 0
Low 2


Any ideas?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sk1C?=
Guest
Posts: n/a
 
      24th Oct 2006
Please don't multipost. See response at other post.


"RobertH" wrote:

> Given the following dummy data (my real data involves hundreds of rows,
>
> hundreds of color columns, and multiple "rank" columns):
>
> A B C D E F G H
> 1 Rank Colors red yellow blue green orange
> 2 John High 2 Y Y
> 3 Paul Med 0
> 4 George Low 1 Y
> 5 Ringo Low 2 Y Y
> 6 Total 1 0 1 2 1
>
>
> I'm trying to come up with a formula (without macros) that will
> calculate the number of colors associated with a Low ranking Beatle
> (result should be 2 because given the data above, there are two colors
> (green and orange) associated with the two Beatles with a rank of
> "Low".
> Note that there are no colors associated with Paul and no Beatles
> associated with Yellow.
>
>
> So, SUMPRODUCT(($B$2:$B$5="Low")*($C$2:$C$5>0)) appears accurate, but
> won't give me the right answer for "High" Beatles because it is
> essentially a row count where colors > 0 for a given Rank.
> I would expect the following values:
>
>
> Rank Colors
> High 2
> Med 0
> Low 2
>
>
> Any ideas?
>
>

 
Reply With Quote
 
RobertH
Guest
Posts: n/a
 
      24th Oct 2006
My bad, wasn't sure if it was a "programming" or "worksheet functions"
question. JMB's very helpful response can be found here:
http://groups.google.com/group/micro...414066c8?hl=en

JMB wrote:
> Please don't multipost. See response at other post.
>
>
> "RobertH" wrote:
>
> > Given the following dummy data (my real data involves hundreds of rows,
> >
> > hundreds of color columns, and multiple "rank" columns):
> >
> > A B C D E F G H
> > 1 Rank Colors red yellow blue green orange
> > 2 John High 2 Y Y
> > 3 Paul Med 0
> > 4 George Low 1 Y
> > 5 Ringo Low 2 Y Y
> > 6 Total 1 0 1 2 1
> >
> >
> > I'm trying to come up with a formula (without macros) that will
> > calculate the number of colors associated with a Low ranking Beatle
> > (result should be 2 because given the data above, there are two colors
> > (green and orange) associated with the two Beatles with a rank of
> > "Low".
> > Note that there are no colors associated with Paul and no Beatles
> > associated with Yellow.
> >
> >
> > So, SUMPRODUCT(($B$2:$B$5="Low")*($C$2:$C$5>0)) appears accurate, but
> > won't give me the right answer for "High" Beatles because it is
> > essentially a row count where colors > 0 for a given Rank.
> > I would expect the following values:
> >
> >
> > Rank Colors
> > High 2
> > Med 0
> > Low 2
> >
> >
> > Any ideas?
> >
> >


 
Reply With Quote
 
=?Utf-8?B?Sk1C?=
Guest
Posts: n/a
 
      24th Oct 2006
Understandable - sometimes it takes a while for a post to show up on the
server. My intent is to direct others to the other post so the discussion
stays in one place.

"RobertH" wrote:

> My bad, wasn't sure if it was a "programming" or "worksheet functions"
> question. JMB's very helpful response can be found here:
> http://groups.google.com/group/micro...414066c8?hl=en
>
> JMB wrote:
> > Please don't multipost. See response at other post.
> >
> >
> > "RobertH" wrote:
> >
> > > Given the following dummy data (my real data involves hundreds of rows,
> > >
> > > hundreds of color columns, and multiple "rank" columns):
> > >
> > > A B C D E F G H
> > > 1 Rank Colors red yellow blue green orange
> > > 2 John High 2 Y Y
> > > 3 Paul Med 0
> > > 4 George Low 1 Y
> > > 5 Ringo Low 2 Y Y
> > > 6 Total 1 0 1 2 1
> > >
> > >
> > > I'm trying to come up with a formula (without macros) that will
> > > calculate the number of colors associated with a Low ranking Beatle
> > > (result should be 2 because given the data above, there are two colors
> > > (green and orange) associated with the two Beatles with a rank of
> > > "Low".
> > > Note that there are no colors associated with Paul and no Beatles
> > > associated with Yellow.
> > >
> > >
> > > So, SUMPRODUCT(($B$2:$B$5="Low")*($C$2:$C$5>0)) appears accurate, but
> > > won't give me the right answer for "High" Beatles because it is
> > > essentially a row count where colors > 0 for a given Rank.
> > > I would expect the following values:
> > >
> > >
> > > Rank Colors
> > > High 2
> > > Med 0
> > > Low 2
> > >
> > >
> > > Any ideas?
> > >
> > >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with an array and SUMPRODUCT xlcharlie Microsoft Excel Worksheet Functions 3 9th Feb 2010 09:16 PM
Using COUNTU in VBA to delete certain values Sietske Microsoft Excel Misc 2 30th Jul 2009 08:29 AM
Sumproduct array Jumbo Jock Microsoft Excel Worksheet Functions 6 8th Apr 2009 01:49 AM
Array or SumProduct or other? TMK Microsoft Excel Worksheet Functions 3 15th Jan 2008 01:59 PM
Sumproduct, array =?Utf-8?B?Um9iZXJ0?= Microsoft Excel Programming 1 13th Sep 2007 05:38 AM


Features
 

Advertising
 

Newsgroups
 


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