Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Heather Murch
 
Posts: n/a
Default COUNTIF cell A1 is x and cell B1 is y

I have two columns - one lists the city; the other lists other criteria; like
colours (green/red, etc).
I want to be able to count the number of 'Red' values in the second column
only if the value in the first column is, say, "Toronto".

So, countif (A1:A1500,"Toronto" AND IF B1:B1500, "Red")
The result might be that there are 500 occurences of "Toronto" but of those,
only 240 are associated with "Red" in the second column. Can you help?
  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

One way

=SUMPRODUCT(--(A1:A1500="Toronto"),--(B1:B500="Red"))

replace the hardcoded criteria with cells like this

=SUMPRODUCT(--(A1:A1500=C1),--(B1:B500=D1))

that way you only need to change the contents of C1 and D1 instead
of editing the formula when you change city and colour


--

Regards,

Peo Sjoblom


"Heather Murch" <Heather wrote in message
...
I have two columns - one lists the city; the other lists other criteria;

like
colours (green/red, etc).
I want to be able to count the number of 'Red' values in the second column
only if the value in the first column is, say, "Toronto".

So, countif (A1:A1500,"Toronto" AND IF B1:B1500, "Red")
The result might be that there are 500 occurences of "Toronto" but of

those,
only 240 are associated with "Red" in the second column. Can you help?



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
Countif cell color is Red? JohnG Excel Worksheet Functions 6 February 11th 05 03:24 PM
COUNTIF text where there is more than one word in a cell Abi Excel Worksheet Functions 2 January 20th 05 03:32 AM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM
VLookup resulting in a blank cell... KempensBoerke Excel Worksheet Functions 1 October 28th 04 09:57 PM


All times are GMT +1. The time now is 01:57 PM.

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"