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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
8,948
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,948
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,948
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,948
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,095,230
Messages
5,443,228
Members
405,219
Latest member
CraneS

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top