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
Ok, be sure to use the formula in Post # 18, post back if it needs further modification or if it works for you.
Hi this works on Emergency but not correctly on Urgent or Routine - I may have to find a simpler way of doing this with less criteria. My post #13
Also none of the Col A dates are ever in the future --- I use DD/MM/YYYY DATE format
 
Upvote 0

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,)
Hi Guys -- this is what I wish to achieve for jobs entered on 19/01/2022 - I cant thank you enough for this
 

Attachments

  • Screenshot 2022-01-19 14.56.37.png
    Screenshot 2022-01-19 14.56.37.png
    62.5 KB · Views: 6
Upvote 0
Can you enter dates in col A & show the expected results based on today's date.
 
Upvote 0
If you cannot be bothered to mock-up some data as requested, then I cannot help.
 
Upvote 0
If you cannot be bothered to mock-up some data as requested, then I cannot help.
Sorry to annoy you Fluff. Its not a matter of not being bothered; its lack of knowledge on the subject. The rows 5, 8 and 14 indicated show the results I require for todays date - I am asking for the formula to make that work and also produce the other criteria shown. Obviously all this will shift as the date changes. Off for a cup of tea now. If you cant help I'll try a simpler version.
 
Upvote 0
This version of my formula is fully tested according to your requirements as I understand it, seems to be working as expected:

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
Sheet943
Cell Formulas
RangeFormula
E5:E20E5=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
This version of my formula is fully tested according to your requirements as I understand it, seems to be working as expected:

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
Sheet943
Cell Formulas
RangeFormula
E5:E20E5=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")
Thank you jtwak - this is exactly what I need. Very much appreciated. It will go to good use in helping to run maintenance schedules in Care Homes in Northern Ireland and perhaps further afield . Thanks again
 
Upvote 0
Thank you jtwak - this is exactly what I need. Very much appreciated. It will go to good use in helping to run maintenance schedules in Care Homes in Northern Ireland and perhaps further afield . Thanks again

You're welcome, glad we finally figured it out, and it works for you.
And by the way, it's jtakw.
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,323
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