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
Hi,

See if this might work for you:

Book3.xlsx
ABCDE
4Date reportedStatusDeadline
51/19/2022EmergencyExpires Tomorrow
61/20/2022UrgentIn Progress
71/19/2022UrgentExpires Tomorrow
81/31/2022RoutineIn Progress
91/14/2022UrgentExpired
101/21/2022UrgentIn Progress
111/18/2022EmergencyExpires Today
121/17/2022UrgentExpired
131/20/2022RoutineAbout to Expire
Sheet943
Cell Formulas
RangeFormula
E5:E13E5=IFERROR(LOOKUP(A5-TODAY(),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

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Can you post some sample data along with expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
Hi again. The data you provided is along the lines of what I would like - My post at 5.32 pm is what I would like it to do. I didnt explain it accurately in my first post; sorry. I dont have any sample data to post.
Can you post some sample data along with expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
Hello again. I dont have any data to post. Will this explain more fully what I would like to achieve please
 

Attachments

  • Screenshot 2022-01-18 22.28.19.png
    Screenshot 2022-01-18 22.28.19.png
    19.2 KB · Views: 6
Upvote 0
Hi again. The data you provided is along the lines of what I would like - My post at 5.32 pm is what I would like it to do. I didnt explain it accurately in my first post; sorry. I dont have any sample data to post.

Hello again. I dont have any data to post. Will this explain more fully what I would like to achieve please
 

Attachments

  • Screenshot 2022-01-18 22.40.25.png
    Screenshot 2022-01-18 22.40.25.png
    20.5 KB · Views: 5
Upvote 0
Did you try my formula in Post #11 ?
 
Upvote 0
No, Based on your original image in your 1st post (Post # 1), just copy and paste my formula in E5 and drag down.
 
Upvote 0
No, Based on your original image in your 1st post (Post # 1), just copy and paste my formula in E5 and drag down.
Thank you for this jtakw - your time is very much appreciated. Unfortunately I managed to confuse myself with the first post. What I wish to have is in my last post. Grateful for your time
 
Upvote 0
Ok, see if this modified version works for you, assuming your Dates are in Column A, Status in Column D, Deadline in Column E, all starting at Row 5, just copy and paste my formula in E5 and drag down:

Book3.xlsx
ABCDE
4Date reportedStatusDeadline
51/18/2022EmergencyExpires Tomorrow
61/20/2022UrgentIn Progress
71/19/2022UrgentIn Progress
81/31/2022RoutineIn Progress
91/14/2022UrgentExpires Today
101/21/2022UrgentIn Progress
111/17/2022EmergencyExpires Today
121/17/2022UrgentIn Progress
131/20/2022RoutineAbout to Expire
141/13/2022UrgentExpired
151/16/2022EmergencyExpired
Sheet943
Cell Formulas
RangeFormula
E5:E15E5=IFERROR(LOOKUP(A5-TODAY()+IF(D5="Emergency",1,IF(D5="Urgent",4,0)),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
Ok, be sure to use the formula in Post # 18, post back if it needs further modification or if it works for you.
 
Upvote 0

Forum statistics

Threads
1,215,519
Messages
6,125,294
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