#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Formula question

Here's my spreadsheet:

Column A Column B
N Red
N Blue
N Red
Orange
N Blue
Red
N Yellow

Here's what I'd like to accomplish:
If there's an "N" in column A, then count the number of times "Red" and
"Blue" appear in column B. If there is no "N" in column A, do not count it.
In the above example, I'd expect the formula to return a result of four.

Thanks for the help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 225
Default Formula question

=SUMPRODUCT(--(A1:A100="N"),--(B1:B100="RED")) +
SUMPRODUCT(--(A1:A100="N"),--(B1:B100="BLUE"))

Change 100 to last row of your data...

"fgbdrum" wrote:

Here's my spreadsheet:

Column A Column B
N Red
N Blue
N Red
Orange
N Blue
Red
N Yellow

Here's what I'd like to accomplish:
If there's an "N" in column A, then count the number of times "Red" and
"Blue" appear in column B. If there is no "N" in column A, do not count it.
In the above example, I'd expect the formula to return a result of four.

Thanks for the help.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Formula question


Try this formula somewhere on the sheet - It assumes that your entries begin
on row 2.
=SUMPRODUCT(--(A2:A8="N"),--(B2:B8="red")) +
SUMPRODUCT(--(A2:A8="N"),--(B2:B8="blue"))
but if the actually start on row 1:
=SUMPRODUCT(--(A1:A7="N"),--(B1:B7="red")) +
SUMPRODUCT(--(A1:A7="N"),--(B1:B7="blue"))


"fgbdrum" wrote:

Here's my spreadsheet:

Column A Column B
N Red
N Blue
N Red
Orange
N Blue
Red
N Yellow

Here's what I'd like to accomplish:
If there's an "N" in column A, then count the number of times "Red" and
"Blue" appear in column B. If there is no "N" in column A, do not count it.
In the above example, I'd expect the formula to return a result of four.

Thanks for the help.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 52
Default Formula question

fgbdrum escribió:
Here's my spreadsheet:

Column A Column B
N Red
N Blue
N Red
Orange
N Blue
Red
N Yellow

Here's what I'd like to accomplish:
If there's an "N" in column A, then count the number of times "Red" and
"Blue" appear in column B. If there is no "N" in column A, do not count it.
In the above example, I'd expect the formula to return a result of four.

Thanks for the help.


You could use
=SUMPRODUCT(--(A1:A100="N"),--(B1:B100={"RED","BLUE"}))

Best Regards,
Pedro J.
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
Formula Question Alison[_2_] Excel Worksheet Functions 6 September 11th 08 01:19 AM
Formula question joker_r_me[_2_] Excel Discussion (Misc queries) 6 April 21st 07 10:22 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Formula Question Bruce D. Excel Discussion (Misc queries) 2 January 5th 06 06:09 PM
formula question Sanford Lefkowitz Excel Discussion (Misc queries) 4 December 20th 05 08:12 PM


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

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"