Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-18-2008, 07:46 AM
Django Cat
 
Posts: n/a
COUNTIF (?) on two criteria

I have a spreadsheet that logs work activities and records team
members' completion of project units.

Column B records team member names. Column C has project unit status -
'pending', 'beta' or 'completed'.

It's easy to set up a formula to count how many units are allocated to
each team member - =COUNTIF(B1:B1000,"Joe"). But what I need to do is
set up formulas to count how many units Joe has completed, or has
pending or at beta, and this means assessing data in both columns -
which COUNTIF won't do.

This doesn't strike me as an especially uncommon thing to want to do,
and I'd guess it may be straightforward - any help from the assembled
Excel experts would be very gratefully received.

DC



--

Reply With Quote
  #2 (permalink)  
Old 05-18-2008, 08:11 AM
Nick Hodge
 
Posts: n/a
Re: COUNTIF (?) on two criteria

Django Cat

How about

=SUMPRODUCT((A1:A17="Joe")*(B1:B17="Beta"))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
web: www.excelusergroup.org
web: www.nickhodge.co.uk





"Django Cat" <notareal@address.co.uk> wrote in message
news:zhQXj.39910$66.7457@newsfe20.ams2...
> I have a spreadsheet that logs work activities and records team
> members' completion of project units.
>
> Column B records team member names. Column C has project unit status -
> 'pending', 'beta' or 'completed'.
>
> It's easy to set up a formula to count how many units are allocated to
> each team member - =COUNTIF(B1:B1000,"Joe"). But what I need to do is
> set up formulas to count how many units Joe has completed, or has
> pending or at beta, and this means assessing data in both columns -
> which COUNTIF won't do.
>
> This doesn't strike me as an especially uncommon thing to want to do,
> and I'd guess it may be straightforward - any help from the assembled
> Excel experts would be very gratefully received.
>
> DC
>
>
>
> --
>

Reply With Quote
  #3 (permalink)  
Old 05-18-2008, 10:04 AM
Django Cat
 
Posts: n/a
Re: COUNTIF (?) on two criteria

Nick Hodge wrote:

> =SUMPRODUCT((A1:A17="Joe")*(B1:B17="Beta"))


Thanks, Nick. Yes, that works. If you've got a minute to post
explaining *how* it works I'd be really grateful - I've not used
SUMPRODUCT before (and I can't see how the * in the middle of the
formula is working).

Django

--

Reply With Quote
  #4 (permalink)  
Old 05-18-2008, 11:15 AM
Nick Hodge
 
Posts: n/a
Re: COUNTIF (?) on two criteria

Django

All SUMPRODUCT does is take a series of arrays and multiply one element by
the same element in the next array and sums the result (product), however it
has lots of other neat uses. Best detailed here
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

In your case it is taking two arrays. A1:A17 and B1:B17. It also has a
criteria on each so each one is coerced into TRUE or FALSE (True = 1, False
= 0)

So if we are looking at the first array/criteria group, looking for "Joe"
you end up with 1 where the cell is Joe and 0 where it is not.

Now take the second array/criteria group, looking for "Beta", again we end
up with an array of 1's, where the cell is "Beta", 0's where it is not.

So, we now have two 'matching' arrays of 0's and 1's.

If we multiply each element of the array (your original question), we get a
series of...

1*1 = 1 (Where "Joe" is TRUE (1) AND "Beta" is TRUE (1))
1*0 = 0 (Where "Joe" is TRUE (1) AND "Beta" is FALSE (0))
0*1 = 0 (Where "Joe" is FALSE (0) AND "Beta" is TRUE (1))

SUMPRODUCT simply now takes these results 1,0,1,0,0,0,1,0 and SUMS them.
Effecting a count of the 1's.

That's probably as clear as mud! Read the web page will probably do more for
you. It can also be used for multiple SUMIF criteria and bear in mind,
Excel 2007 has a few multi-criteria ones build in

SUMIFS, COUNTIFS, AVERAGEIFS...

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
web: www.excelusergroup.org
web: www.nickhodge.co.uk





"Django Cat" <notareal@address.co.uk> wrote in message
news:UiSXj.39921$66.1664@newsfe20.ams2...
> Nick Hodge wrote:
>
>> =SUMPRODUCT((A1:A17="Joe")*(B1:B17="Beta"))

>
> Thanks, Nick. Yes, that works. If you've got a minute to post
> explaining *how* it works I'd be really grateful - I've not used
> SUMPRODUCT before (and I can't see how the * in the middle of the
> formula is working).
>
> Django
>
> --
>

Reply With Quote
  #5 (permalink)  
Old 05-18-2008, 11:28 AM
Django Cat
 
Posts: n/a
Re: COUNTIF (?) on two criteria

Nick Hodge wrote:

> From: "Nick Hodge" <nick_hodge@zen.co.uk>
> Subject: Re: COUNTIF (?) on two criteria
> Date: Sun, 18 May 2008 11:15:24 +0100
> Newsgroups: microsoft.public.excel
>
> Django
>
> All SUMPRODUCT does is take a series of arrays and multiply one
> element by the same element in the next array and sums the result
> (product), however it has lots of other neat uses. Best detailed here
> http://www.xldynamic.com/source/xld.SUMPRODUCT.html
>
> In your case it is taking two arrays. A1:A17 and B1:B17. It also has
> a criteria on each so each one is coerced into TRUE or FALSE (True =
> 1, False = 0)
>
> So if we are looking at the first array/criteria group, looking for
> "Joe" you end up with 1 where the cell is Joe and 0 where it is not.
>
> Now take the second array/criteria group, looking for "Beta", again
> we end up with an array of 1's, where the cell is "Beta", 0's where
> it is not.
>
> So, we now have two 'matching' arrays of 0's and 1's.
>
> If we multiply each element of the array (your original question), we
> get a series of...
>
> 1*1 = 1 (Where "Joe" is TRUE (1) AND "Beta" is TRUE (1))
> 1*0 = 0 (Where "Joe" is TRUE (1) AND "Beta" is FALSE (0))
> 0*1 = 0 (Where "Joe" is FALSE (0) AND "Beta" is TRUE (1))
>
> SUMPRODUCT simply now takes these results 1,0,1,0,0,0,1,0 and SUMS
> them. Effecting a count of the 1's.
>
> That's probably as clear as mud!


No, it does make sense.

Read the web page will probably do
> more for you.


Will do.

It can also be used for multiple SUMIF criteria and
> bear in mind, Excel 2007 has a few multi-criteria ones build in
>
> SUMIFS, COUNTIFS, AVERAGEIFS...


Thanks again, and I'll have a play with those various functions.


Django
Sotonian Born and Bred, once of Chandlers Ford, now in Derbyshire.

--

Reply With Quote
  #6 (permalink)  
Old 05-18-2008, 01:09 PM
Nick Hodge
 
Posts: n/a
Re: COUNTIF (?) on two criteria

Actually, I am Chandlers Ford too, just few people know where that is!

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
web: www.excelusergroup.org
web: www.nickhodge.co.uk





"Django Cat" <notareal@address.co.uk> wrote in message
news:dxTXj.15913$ie5.13853@newsfe05.ams2...
> Nick Hodge wrote:
>
>> From: "Nick Hodge" <nick_hodge@zen.co.uk>
>> Subject: Re: COUNTIF (?) on two criteria
>> Date: Sun, 18 May 2008 11:15:24 +0100
>> Newsgroups: microsoft.public.excel
>>
>> Django
>>
>> All SUMPRODUCT does is take a series of arrays and multiply one
>> element by the same element in the next array and sums the result
>> (product), however it has lots of other neat uses. Best detailed here
>> http://www.xldynamic.com/source/xld.SUMPRODUCT.html
>>
>> In your case it is taking two arrays. A1:A17 and B1:B17. It also has
>> a criteria on each so each one is coerced into TRUE or FALSE (True =
>> 1, False = 0)
>>
>> So if we are looking at the first array/criteria group, looking for
>> "Joe" you end up with 1 where the cell is Joe and 0 where it is not.
>>
>> Now take the second array/criteria group, looking for "Beta", again
>> we end up with an array of 1's, where the cell is "Beta", 0's where
>> it is not.
>>
>> So, we now have two 'matching' arrays of 0's and 1's.
>>
>> If we multiply each element of the array (your original question), we
>> get a series of...
>>
>> 1*1 = 1 (Where "Joe" is TRUE (1) AND "Beta" is TRUE (1))
>> 1*0 = 0 (Where "Joe" is TRUE (1) AND "Beta" is FALSE (0))
>> 0*1 = 0 (Where "Joe" is FALSE (0) AND "Beta" is TRUE (1))
>>
>> SUMPRODUCT simply now takes these results 1,0,1,0,0,0,1,0 and SUMS
>> them. Effecting a count of the 1's.
>>
>> That's probably as clear as mud!

>
> No, it does make sense.
>
> Read the web page will probably do
>> more for you.

>
> Will do.
>
> It can also be used for multiple SUMIF criteria and
>> bear in mind, Excel 2007 has a few multi-criteria ones build in
>>
>> SUMIFS, COUNTIFS, AVERAGEIFS...

>
> Thanks again, and I'll have a play with those various functions.
>
>
> Django
> Sotonian Born and Bred, once of Chandlers Ford, now in Derbyshire.
>
> --
>

Reply With Quote
  #7 (permalink)  
Old 05-18-2008, 01:23 PM
Bob Phillips
 
Posts: n/a
Re: COUNTIF (?) on two criteria

They do, they just don't admit it!

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Nick Hodge" <nick_hodge@zen.co.uk> wrote in message
news:OpjtHAOuIHA.748@TK2MSFTNGP05.phx.gbl...
> Actually, I am Chandlers Ford too, just few people know where that is!
>
> --
> HTH
> Nick Hodge
> Microsoft MVP - Excel
> Southampton, England
> nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
> web: www.excelusergroup.org
> web: www.nickhodge.co.uk
>
>
>
>
>
> "Django Cat" <notareal@address.co.uk> wrote in message
> news:dxTXj.15913$ie5.13853@newsfe05.ams2...
>> Nick Hodge wrote:
>>
>>> From: "Nick Hodge" <nick_hodge@zen.co.uk>
>>> Subject: Re: COUNTIF (?) on two criteria
>>> Date: Sun, 18 May 2008 11:15:24 +0100
>>> Newsgroups: microsoft.public.excel
>>>
>>> Django
>>>
>>> All SUMPRODUCT does is take a series of arrays and multiply one
>>> element by the same element in the next array and sums the result
>>> (product), however it has lots of other neat uses. Best detailed here
>>> http://www.xldynamic.com/source/xld.SUMPRODUCT.html
>>>
>>> In your case it is taking two arrays. A1:A17 and B1:B17. It also has
>>> a criteria on each so each one is coerced into TRUE or FALSE (True =
>>> 1, False = 0)
>>>
>>> So if we are looking at the first array/criteria group, looking for
>>> "Joe" you end up with 1 where the cell is Joe and 0 where it is not.
>>>
>>> Now take the second array/criteria group, looking for "Beta", again
>>> we end up with an array of 1's, where the cell is "Beta", 0's where
>>> it is not.
>>>
>>> So, we now have two 'matching' arrays of 0's and 1's.
>>>
>>> If we multiply each element of the array (your original question), we
>>> get a series of...
>>>
>>> 1*1 = 1 (Where "Joe" is TRUE (1) AND "Beta" is TRUE (1))
>>> 1*0 = 0 (Where "Joe" is TRUE (1) AND "Beta" is FALSE (0))
>>> 0*1 = 0 (Where "Joe" is FALSE (0) AND "Beta" is TRUE (1))
>>>
>>> SUMPRODUCT simply now takes these results 1,0,1,0,0,0,1,0 and SUMS
>>> them. Effecting a count of the 1's.
>>>
>>> That's probably as clear as mud!

>>
>> No, it does make sense.
>>
>> Read the web page will probably do
>>> more for you.

>>
>> Will do.
>>
>> It can also be used for multiple SUMIF criteria and
>>> bear in mind, Excel 2007 has a few multi-criteria ones build in
>>>
>>> SUMIFS, COUNTIFS, AVERAGEIFS...

>>
>> Thanks again, and I'll have a play with those various functions.
>>
>>
>> Django
>> Sotonian Born and Bred, once of Chandlers Ford, now in Derbyshire.
>>
>> --
>>



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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



All times are GMT. The time now is 04:39 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Mobile Phone | Personal Loans | Online Loans | Mobile Phones | Mortgages



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114