Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rae Rae is offline
external usenet poster
 
Posts: 27
Default Using a function to count cells based on multiple criteria

I am trying to count the values of a cell range based on two different cell
ranges containing certain data.

For example:
cell range a2 - a4 contains apples
cell range a5 - a8 contains pears
cell range a9 - a10 contains apples
and cell range d2 - d7 contains red
and cell range d8 - d10 contains green

count cell range d2-d10 that has a value of red AND cell range a2-a10 has a
value of apples and return a value of 5 (5 records/rows have a value of
apples and red)

Does this make sense?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Using a function to count cells based on multiple criteria

return a value of 5 (5 records/rows have a value of apples and red)
Does this make sense?


No. The correct result would be 3. Here's how you do it:

=SUMPRODUCT(--(A2:A10="apples"),--(D2:D10="red"))

Or, use cells to hold the ctieria:

E1 = apples
F1 = red

=SUMPRODUCT(--(A2:A10=E1),--(D2:D10=F1))


--
Biff
Microsoft Excel MVP


"Rae" wrote in message
...
I am trying to count the values of a cell range based on two different cell
ranges containing certain data.

For example:
cell range a2 - a4 contains apples
cell range a5 - a8 contains pears
cell range a9 - a10 contains apples
and cell range d2 - d7 contains red
and cell range d8 - d10 contains green

count cell range d2-d10 that has a value of red AND cell range a2-a10 has
a
value of apples and return a value of 5 (5 records/rows have a value of
apples and red)

Does this make sense?

Thanks



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 based on multiple criteria JerryS Excel Worksheet Functions 1 October 9th 07 06:37 PM
How do I get the count in excel based on criteria in multiple col Sunil Mariyappa Excel Worksheet Functions 1 October 3rd 07 06:00 PM
count based on multiple date criteria lisaw Excel Worksheet Functions 1 August 9th 05 05:31 PM
how do i count values based on multiple criteria sean Excel Worksheet Functions 2 January 7th 05 01:00 AM
Count rows based on multiple criteria Murph Excel Worksheet Functions 1 October 28th 04 07:13 AM


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