Need help with IF statement calculating Dates

lorne17

New Member
Joined
Mar 28, 2017
Messages
15
Hello there,

I have a cell that marks an action item as priority 1, 2, or 3 depending in criticality of the item. I'd like to change this from a manual entry and have it look at Column J (which is the due date column) and change the priroity of the number depending on the due date. If it's 0-7 days from due date I want it to be "1", if it's 8-14 days from due date I want it to be "2", and if it's 15+ days I want it to be priority "3". I'd also like the priority to change to "PAST DUE" if the due date has passed.

How might I go about doing this? I started with a simple formula (not trying to tackle the entire formula quite yet) with the formula below. But unfortunately I keep getting an error message:

Code:
=IF((J7-TODAY()>=0,J7-TODAY()<=7),"1","2")

Thoughts?

Thanks,
Lorne
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try:
Code:
<today(),"past due",if(and(j7="">=IF(J7="","",IF(J7 < TODAY(),"PAST DUE",IF(AND(J7>=TODAY(),J7<=TODAY()+7),1,IF(AND(J7>=TODAY()+8,J7<=TODAY()+14),2,3))))
</today(),"past>
 
Last edited:
Upvote 0
JoeMo, I get an error when trying yours :(

Jonmo1, your equation worked great. Now I'm trying to complicate things and can't get it to work. Basically if the Due By date in J8 is past due, I want it to say "PAST DUE". If the J column is blank, I want it to read "NO DUE DATE".
<today(),"past due",if(j8="" ,"no="" due="" date",match(j8-today(),{0,8,15})))[="" code]
<today(),if(j8="","no due="" date",match(j8-today(),{0,8,15}))[="" code]
<today(),if(j8="","no due="" date",match(j8-today(),{0,8,15}))
=IF(J8 < TODAY(),IF(J8="","NO DUE DATE",MATCH(J8-TODAY(),{0,8,15}))
Why won't this formula work? I keep getting an error. I did get this one to work:

Code:
=IF(J8="","NO DUE DATE",MATCH(J8-TODAY(),{0,8,15}))

Thank you!
Lorne</today(),if(j8="","no></today(),if(j8="","no></today(),"past>
 
Last edited:
Upvote 0
JoeMo, I get an error when trying yours :(<today(),"past due",if(j8="" ,"no="" due="" date",match(j8-today(),{0,8,15})))[="" code]

Thank you!
Lorne
You need to remove the spaces around the first "less than" symbol ( < ) - had to put them there to keep the symbol from being interpreted as an html character.


</today(),"past>
 
Last edited:
Upvote 0
I assume then the match function errors when it's past due.

Try

=If(J7="","No Due Date",IFERROR(MATCH(J7-TODAY(),{0,8,15}),"Past Due"))
 
Upvote 0
I assume then the match function errors when it's past due.

Try

=If(J7="","No Due Date",IFERROR(MATCH(J7-TODAY(),{0,8,15}),"Past Due"))

I'd imagine that should work. But when I try it I get an error popup "This value doesn't match the data validation restrictions defined for this cell". When I click Retry it automatically changes the formula to this:

Code:
=IF(RC[7]="","No Due Date",IFERROR(MATCH(RC[7]-TODAY(),{0,8,15}),"Past Due"))
 
Upvote 0
What's the data validation rule for that cell ?

Come to think of it, if you're putting a formula in that cell, then you shouldn't have data validation in that cell also.
Remove the validation on the Data Tab for that cell
 
Last edited:
Upvote 0
Ok to follow this up, when trying this on a different spreadsheet it works? Not sure what's going on, any ideas?
 
Upvote 0
What's the data validation rule for that cell ?

Come to think of it, if you're putting a formula in that cell, then you shouldn't have data validation in that cell also.
Remove the validation on the Data Tab for that cell

Ok that worked. I needed to go to the Data Validation popup and select "CLEAR ALL".

Thank you!

Lorne
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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