Formula with many conditions required please

Orangeanorak

Active Member
Joined
Nov 22, 2002
Messages
276
Office Version
  1. 365
Platform
  1. Windows
Grateful if a formula can be supplied for this one please. No VBA if possible
Column E deadline
If D5 = Emergency and the date in A5 is equals today insert text "In Progress" if = 1 day more insert text "Expires Today" if more than 1 day insert text "Expired"
If D5 = Urgent and the date in A5 is less than 3 days ahead insert text "In Progress" if = 3 days ahead insert text "About to Expire" if 4 days ahead insert text "Expires Today" if more than 4 days insert text "Expired"
If D5 = Routine and the date in A5 is less than 24 days ahead insert text "In Progress" if 24 to 27 days ahead insert text "About to Expire" if 28 days ahead insert text "Expires Today" if more than 28 days insert text "Expired"

Thank you --------- Mission Impossible ?????
 

Attachments

  • Screenshot 2022-01-18 15.35.58.png
    Screenshot 2022-01-18 15.35.58.png
    34.8 KB · Views: 21
You're welcome, glad we finally figured it out, and it works for you.
And by the way, it's jtakw.
My apologies jtakw - my keyboard skills are almost as bad as my excel skills!!
May I ask you one more thing please.
If there is no date in Col A can Col D be blank
Thank you
 

Attachments

  • Screenshot 2022-01-19 19.31.45.png
    Screenshot 2022-01-19 19.31.45.png
    66.2 KB · Views: 4
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
No problem, just add a check for blanks in A:

Book3.xlsx
ABCDE
4Date reportedStatusDeadline
51/19/2022EmergencyExpires Tomorrow
61/18/2022EmergencyExpires Today
71/17/2022EmergencyExpired
81/19/2022UrgentIn Progress
91/18/2022UrgentIn Progress
101/17/2022UrgentIn Progress
111/16/2022UrgentExpires Tomorrow
121/15/2022UrgentExpires Today
131/14/2022UrgentExpired
141/19/2022RoutineIn Progress
1512/29/2021RoutineIn Progress
1612/28/2021RoutineAbout to Expire
1712/24/2021RoutineAbout to Expire
1812/23/2021RoutineExpires Tomorrow
1912/22/2021RoutineExpires Today
2012/21/2021RoutineExpired
21 
22 
Sheet943
Cell Formulas
RangeFormula
E5:E22E5=IF(A5="","",IFERROR(LOOKUP(A5-TODAY()+IF(D5="Emergency",1,IF(D5="Urgent",4,28)),IF(D5="Routine",{0,1,2,7},{0,1,2}),IF(D5="Routine",{"Expires Today","Expires Tomorrow","About to Expire","In Progress"},{"Expires Today","Expires Tomorrow","In Progress"})),"Expired"))
 
Upvote 0
Thank you - just some drop downs and conditional formatting and thats me sorted - exceptionally helpful. (y)
 
Upvote 0
You're very welcome, thanks for the feedback.
Hi - sorry to bother you again jtakw - would it be possible to add another criteria to the formula please

If D5 is Long Term - if A5 is equal to or up to 80 days from today show "In Progress" if 81 to 88 days from today show "About to Expire", if 89 days show "Expires Tomorrow, if 90 days show "Expires Today, if more than 90 days show "Expired"

Thank you!
 
Upvote 0
jtakw - would it be possible to add another criteria to the formula please

If D5 is Long Term - if A5 is equal to or up to 80 days from today show "In Progress" if 81 to 88 days from today show "About to Expire", if 89 days show "Expires Tomorrow, if 90 days show "Expires Today, if more than 90 days show "Expired"

Thank you!

This should do it, test it on your data to confirm:

Book3.xlsx
ABCDE
4Date reportedStatusDeadline
51/22/2022EmergencyExpires Tomorrow
61/21/2022EmergencyExpires Today
71/20/2022EmergencyExpired
81/22/2022UrgentIn Progress
91/21/2022UrgentIn Progress
101/20/2022UrgentIn Progress
111/19/2022UrgentExpires Tomorrow
121/18/2022UrgentExpires Today
131/17/2022UrgentExpired
141/22/2022RoutineIn Progress
151/1/2022RoutineIn Progress
1612/31/2021RoutineAbout to Expire
1712/27/2021RoutineAbout to Expire
1812/26/2021RoutineExpires Tomorrow
1912/25/2021RoutineExpires Today
2012/24/2021RoutineExpired
211/22/2022Long TermIn Progress
2211/3/2021Long TermIn Progress
2311/2/2021Long TermAbout to Expire
2410/26/2021Long TermAbout to Expire
2510/25/2021Long TermExpires Tomorrow
2610/24/2021Long TermExpires Today
2710/23/2021Long TermExpired
Sheet943
Cell Formulas
RangeFormula
E5:E27E5=IF(A5="","",IFERROR(LOOKUP(A5-TODAY()+IF(D5="Emergency",1,IF(D5="Urgent",4,IF(D5="Routine",28,90))),IF(D5="Routine",{0,1,2,7},IF(D5="Long Term",{0,1,2,10},{0,1,2})),IF(OR(D5={"Routine","Long Term"}),{"Expires Today","Expires Tomorrow","About to Expire","In Progress"},{"Expires Today","Expires Tomorrow","In Progress"})),"Expired"))
 
Upvote 0
Solution
This should do it, test it on your data to confirm:

Book3.xlsx
ABCDE
4Date reportedStatusDeadline
51/22/2022EmergencyExpires Tomorrow
61/21/2022EmergencyExpires Today
71/20/2022EmergencyExpired
81/22/2022UrgentIn Progress
91/21/2022UrgentIn Progress
101/20/2022UrgentIn Progress
111/19/2022UrgentExpires Tomorrow
121/18/2022UrgentExpires Today
131/17/2022UrgentExpired
141/22/2022RoutineIn Progress
151/1/2022RoutineIn Progress
1612/31/2021RoutineAbout to Expire
1712/27/2021RoutineAbout to Expire
1812/26/2021RoutineExpires Tomorrow
1912/25/2021RoutineExpires Today
2012/24/2021RoutineExpired
211/22/2022Long TermIn Progress
2211/3/2021Long TermIn Progress
2311/2/2021Long TermAbout to Expire
2410/26/2021Long TermAbout to Expire
2510/25/2021Long TermExpires Tomorrow
2610/24/2021Long TermExpires Today
2710/23/2021Long TermExpired
Sheet943
Cell Formulas
RangeFormula
E5:E27E5=IF(A5="","",IFERROR(LOOKUP(A5-TODAY()+IF(D5="Emergency",1,IF(D5="Urgent",4,IF(D5="Routine",28,90))),IF(D5="Routine",{0,1,2,7},IF(D5="Long Term",{0,1,2,10},{0,1,2})),IF(OR(D5={"Routine","Long Term"}),{"Expires Today","Expires Tomorrow","About to Expire","In Progress"},{"Expires Today","Expires Tomorrow","In Progress"})),"Expired"))
All tested - perfect - Thank you - I will try not to bother you again. Enjoy the rest of your weekend
 
Upvote 0
All tested - perfect - Thank you - I will try not to bother you again. Enjoy the rest of your weekend

You're welcome, it's no bother at all, if you need further adjustments, just post back.
You also have a good weekend.
 
Upvote 0
Hi jtakw - I have now completed my spreadsheet named Schedule - Thank you for your help.
I now wish to copy cells from the schedule to a number of forms/documents (1-10). I have attached a copy of the cells I wish to Copy from Schedule to Form 1 - I can do this by direct reference between form 1 and schedule taking data from the first row ---- row 5
Schedule to Form 1
A5 to C3
C5 to C8
C5 to C9
I5 to C11
K5 to C12
J5 to E12
L5 to A13:F22
D5 :E26
A5 to C26


Is it possible to set up a formula to copy the relevant cells in Schedule row 6 to form 2, row 7 to form 3, row 8 to form 4 and so on - I will probably need this for 100 forms but dont wish to do it manually.

Thank you - I hope I have explained this properly
 

Attachments

  • forms1_10.jpg
    forms1_10.jpg
    193.3 KB · Views: 2
Upvote 0
As the formulas would Have to be in the Target Sheet (e.g. form 1, form 2, form3, etc.) and Not the Schedule Sheet, you will, unfortunately have to Manually enter those formula in each form/sheet.
You can probably get this done by VBA, but I'm not strong with VBA and unable to help using this method.
 
Upvote 0

Forum statistics

Threads
1,215,519
Messages
6,125,298
Members
449,218
Latest member
Excel Master

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