COUNTIF with multiple conditions from different sheets

alinpion

Board Regular
Joined
Jul 12, 2011
Messages
79
Hello !!

I got two sheets ("data" and "statistic") in one I got two clomuns one with numbers and another with names like in the example:
in "data" sheet :

A ---B
1 ---John
0 ---Danny
6 ---Mary
0 ---John
24 --Danny
0 ---Mary

I want (in sheet two "statistic") to count each time 0 appears on each name

something like:

IF B="John" and A=0 COUNT 1
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
= COUNTIF(data!A:A,"John")

This I konw but I need the formula to count if bouth conditions are true B=John and A=0

The table that I presented above is just an example ; the table that I work with is much bigger and 0 appears many times for one name.
 
Upvote 0
I corrected my formula. See previous post! :)
 
Upvote 0
Press Ctrl+Shift+Enter:
= SUM((data!A:A=0)*(data!B:B="John"))
 
Upvote 0
Hello !!

I got two sheets ("data" and "statistic") in one I got two clomuns one with numbers and another with names like in the example:
in "data" sheet :

A ---B
1 ---John
0 ---Danny
6 ---Mary
0 ---John
24 --Danny
0 ---Mary

I want (in sheet two "statistic") to count each time 0 appears on each name

something like:

IF B="John" and A=0 COUNT 1
Also...

Control+shift+enter, not just enter:

=SUM(IF(ISNUMBER($A$2:$A$7),IF($A$2:$A$7=0,IF($B$2:$B$7=E2,1))))

Or, just enter:

=SUMPRODUCT(--ISNUMBER($A$2:$A$7),--($A$2:$A$7=0),--($B$2:$B$7=E2))

where E2 houses a value like John.
 
Upvote 0
Press Ctrl+Shift+Enter:
= SUM((data!A:A=0)*(data!B:B="John"))

Is not working ;r esponse #NUM!

Is there a way that I could replace the COUNTIFS with SUMPRODUCT and COUNTIF

All I need is a COUNTIF that has two criteria : if = with "John" and with "0" count 1
 
Upvote 0
Also...

Control+shift+enter, not just enter:

=SUM(IF(ISNUMBER($A$2:$A$7),IF($A$2:$A$7=0,IF($B$2:$B$7=E2,1))))

Or, just enter:

=SUMPRODUCT(--ISNUMBER($A$2:$A$7),--($A$2:$A$7=0),--($B$2:$B$7=E2))

where E2 houses a value like John.

First works formula works
=SUM(IF(ISNUMBER($A$2:$A$7),IF($A$2:$A$7=0,IF($B$2:$B$7=E2,1))))
I just replaced E2 with John

Thanks for your help !!!:):)
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,555
Members
452,928
Latest member
101blockchains

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top