having trouble with countif and 2 criteria (date AND nonblank?)

bran987

New Member
Joined
Jan 10, 2005
Messages
45
Hello Everyone

So I have my countif if past a certain date, which works fine:

=COUNTIF(J89:J128,">="&Sheet1!$A$2)

but what I need is this...

How do I count... but only if a date is past a certain range AND the cell next to it is nonblank?


Thanks so much for any help.
 
Last edited:

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try this...
=sumproduct(--(J89:J128>=Sheet1!$A$2),--(K89:K128<>""))

Hmm..

Doesn't seem to have quite worked.

So for instance just pretend:

ColumnA ColumnB
3/15/08 notblank
3/30/08
4/15/08 notblank
4/30/08


ColumnA/B Row 1 wouldn't be counted because 3/15/08 has already passed (even though it's notblank)
ColumnA/B Row 2 wouldn't count because 3/30/08 has already passed (and it's blank)
ColumnA/B Row 3 wouldn't count because even though 4/15/08 is in the future, the cell next to it is already filled
ColumnA/B Row 4 WOULD count because 4/30/08 hasn't passed and the cell next to it is not filled


So the count would be 1 (only one date is still in the future and has a blank cell next to it).

I hope that helps thanks so much for your effort!
 
Upvote 0
Book1
ABCD
13/15/2008notblank1
23/30/2008
34/15/2008notblank
44/30/2008
Sheet1

I really appreciate your help, but when I add another row to that formula I still get the result of 1, instead of a running count

So I added another row
5/15/08

and changed the formula to:

=SUMPRODUCT(--(A1:A5>=TODAY()),--(B1:B5<>""))

?

but the result was still 1, not 2?
 
Upvote 0
change it to the following if you meant to say where the cell next to it equaled blanks
=SUMPRODUCT(--(A1:A5>=TODAY()),--(B1:B5=""))

NOTE: based on original post you had
AND the cell next to it is nonblank?
 
Upvote 0
change it to the following if you meant to say where the cell next to it equaled blanks
=SUMPRODUCT(--(A1:A5>=TODAY()),--(B1:B5=""))

NOTE: based on original post you had

Wow you are completely correct. I apologize for getting that backwards.

Your formula does exactly what I need. THANK YOU!
 
Upvote 0
you can also try this...not sure which way is "preferred"...both should work...

=SUMPRODUCT(--(A1:A5>=TODAY()),--(ISBLANK(B1:B5)))
 
Upvote 0
not sure which way is "preferred"...both should work

I don't think either is "preferred", but there is a difference. The particular situation well determine which one to use...

Here's the difference, and it's a big difference.

="" WILL count Formulas that result in ""
ISBLANK WILL NOT count Formulas that resut in ""
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,331
Members
449,077
Latest member
jmsotelo

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