ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   if...then (https://www.excelbanter.com/excel-discussion-misc-queries/101605-if-then.html)

savbci

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


Harald Staff

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





All times are GMT +1. The time now is 05:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com