COUNTIF Problem

shane72

New Member
Joined
Jun 2, 2009
Messages
39
Hello all,

I have 2 columns and i'm trying to do the following:

column A - i want to count all the cells that have some kind of data in them, but only count them if there is a YES in column B of that row.

col a col b

123 yes = count this one
456 blank = dont count this one
789 yes = count this one

thanks..
shane
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Excel 2003 and lower:
=SUMPRODUCT(--(A1:A3<>""),--(B1:B3<>"Yes"))

Sumproduct calculates like an array formula, and as such using whole columns can be quite taxing on excel, so I'd recommend using an actual range as shown or you can use a dynamic named range.

For Excel 2007 and higher:
=COUNTIFS(A:A,"<>",B:B,"<>yes")

The CountIfs will do the same thing, and isn't calculated like an array formula so it should be fine to use the whole column if desired.
 
Upvote 0
Sorry about this. I typed it wrong..

I'm trying to count items in column A when the cells in column B are blank, not YES.

I will have a few things in rows 1 thru 5, so i need it to start at row 6.

col a col b
123 yes = dont count
456 blank = count it
789 yes = dont count

Thanks.
 
Upvote 0

Forum statistics

Threads
1,222,441
Messages
6,166,056
Members
452,010
Latest member
triangle3

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