#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default if...then

How would i do the following:
I have 2 columns - Column A and Column B. I want to count the number of
'YES' in column B ONLY when Column A is blank.

IE.
Column A Column B
YES
TEST YES
TEST2 NO
YES

I want the result to be 2.

I'm sure my next question is pretty similar:
If this is another spreadsheet Column A and Column B. How do I count all the
'COFFEE' in column B ONLY when column A value is 'MILK'?

IE:
Column A Column B
MLK COFFEE
CREAM RED
TEST2 COFFEE
MILK COFFEE
MILK RED

I want my result to count 2 coffee

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,327
Default if...then

=SUMPRODUCT((A1:A100="")*(B1:B100="YES"))
=SUMPRODUCT((A1:A100="MILK")*(B1:B100="COFFEE"))
you can build these things pretty wide:
=SUMPRODUCT((A1:A100="MILK")*(B1:B100="COFFEE")*(C 1:C100=TODAY())*(D1:D100=
"BEN"))

HTH. Best wishes Harald

"savbci" skrev i melding
...
How would i do the following:
I have 2 columns - Column A and Column B. I want to count the number of
'YES' in column B ONLY when Column A is blank.

IE.
Column A Column B
YES
TEST YES
TEST2 NO
YES

I want the result to be 2.

I'm sure my next question is pretty similar:
If this is another spreadsheet Column A and Column B. How do I count all

the
'COFFEE' in column B ONLY when column A value is 'MILK'?

IE:
Column A Column B
MLK COFFEE
CREAM RED
TEST2 COFFEE
MILK COFFEE
MILK RED

I want my result to count 2 coffee



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



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