Countifs formula based on multiple criteria and a date less than today

jme_4477

New Member
Joined
Mar 24, 2016
Messages
43
Hello again,

I do have one more question for you....In this formula:
=IFERROR(IF(OR(INDEX(Sheet2!$K$2:$K$138,MATCH(B2,Sheet2!$C$2:$C$138,0))="",-7),1,0),0)

How do I have it calculate ONLY if the cell in Sheet 2 column K is blank and it's been more than 7 days? So once a date is entered in column K (even if it's after 7 days) it no longer will total?
 

Some videos you may like

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
8,098
Office Version
2019
Platform
Windows
Not sure if I'm reading the information correctly, see if this does it.

=IFERROR(IF((INDEX(Sheet2!$K$2:$K$138,MATCH(B2,Sheet2!$C$2:$C$138,0))-TODAY())<7,1,0),0)

As you said 'Sheet 2 column K is blank' I've assumed formulas that show a blank using "". If column K is empty then the results will most likely be wrong.
 

jme_4477

New Member
Joined
Mar 24, 2016
Messages
43
Thank you for your help. That didn't work though :( It actually counted everyone.

What I'm looking for is a formula that only calculates the more than 7 days until there is a date entered.

So if we are on the Enrollment tab, look at column G, this column should only count a total if no date appears in So the formula is looking at Sheet 2, Column G:

=IFERROR(IF(OR(INDEX(Sheet2!$J$2:$J$18,MATCH(B2,Sheet2!$C$2:$C$18,0))="",INDEX(Sheet2!$J$2:$J$18,MATCH(B2,Sheet2!$C$2:$C$18,0))-7 > A2),1,0),0)

It’s comparing the date in Enrollment tab, Column A to Sheet 2, Column J. It’s looking to see if there’s a date past 7 days in there. What I need, though, is it only to look if there’s a date past 7 days if 1) in Sheet 2 there’s an ID number in Column C, 2) there’s nothing entered in Sheet 2, Column J, and 3) if it’s been longer than 7 days based on the date in Enrollment tab, Column A.

I can probably modify the other formulas in the Enrollment tabs J and M once I know how to do this, but for everything, I need it not to calculate any longer once a date is entered.

Does this help?

Thank you again!!!
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
8,098
Office Version
2019
Platform
Windows
There's something in there that is just not clicking into place with me, it would be easier to follow if you could upload another sample file, perhaps highlight the entries that should be counted, that should make it a bit clearer.
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
8,098
Office Version
2019
Platform
Windows
For some silly reason the proverbial penny is still not dropping, looking at the enrolment tab it looks like the formulas that you already have are giving you the results that you're asking for.

The 2 records that your notes say are blank in column J of sheet 2 are not blank, however they are blank in column K which could be leading to some confusion.
 

jme_4477

New Member
Joined
Mar 24, 2016
Messages
43
Oh my goodness....It's not the proverbial penny....It's me :( I think I got myself confused. Can you take another look at the doc? I think I've figured out how to word it. So sorry!!!
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
8,098
Office Version
2019
Platform
Windows
I'm still confused, with the date missing in sheet 2, there is nothing to compare to the date in column A to establish if it is more than 7 days.

I thought that you might want 7 days from the current date, but the examples are only 4 days and 2 days?
 

Watch MrExcel Video

Forum statistics

Threads
1,090,379
Messages
5,414,104
Members
403,515
Latest member
see_mido

This Week's Hot Topics

Top