Nested If with dates & multiple day variables

Charger_R_T

New Member
Joined
Sep 8, 2023
Messages
20
Office Version
  1. 2016
Platform
  1. Windows
I'm looking to place this formula in the status colume. I'll use row A15 as my example.
If A15 is blank, C15=blank
IF A15 has text, but no dates entered through E15:AM15, AO:AP, and AR:AT "Incomplete"
If E15:AM15, AO:AP, and AR:AT has a date over 365 days prior to today or If AL15:AM15 and AR15:AS15, has a date over 1095 days prior to today, "Expired". Even if there are dates within this row that are current or expiring soon.
If E15:AM15, AO:AP, and AR:AT has a date between 335-365 days prior to today or If AL15:AM15 and AR15:AS15 has a date between 1065-1095 days prior to today, "Expires Soon". Even if there are dates within this row that are current.
IF E15:AM15, AO:AP, and AR:AT has all dates within 335 days prior to today and IF AL15:AM15 and AR15:AS15 has all dates within 1065, "Safety Qualified"

Row AN, AQ, AS will not be part of the formula.

1694458429976.png
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Corrected some language from my original post. Sorry for the confusion.

If A15 is blank, C15=blank
IF A15 has text, but no dates entered through E15:AM15, AO15:AP15, and AR15:AT15 "Incomplete"
If E15:AM15, AO15:AP15, and AR15:AT15 has a date over 365 days prior to today or If AL15:AM15 and AR15:AS15, has a date over 1095 days prior to today, "Expired". Even if there are dates within this row that are current or expiring soon.
If E15:AM15, AO15:AP15, and AR15:AT15 has a date between 335-365 days prior to today or If AL15:AM15 and AR15:AS15 has a date between 1065-1095 days prior to today, "Expires Soon". Even if there are dates within this row that are current.
IF E15:AM15, AO15:AP15, and AR15:AT15 has all dates within 335 days prior to today and IF AL15:AM15 and AR15:AS15 has all dates within 1065, "Safety Qualified"

Columns AN, AQ, AS will not be part of the formula.
 
Upvote 0
try this, i also included a version at the end for 365 users
--------------------
Nested If with dates & multiple day variables.xlsx
ABCDEFGHIJKLMPQRSTUVAAABACADALAMANAOAPAQARASATAX
1converting machine 1converting machine 2converting machine 3converting machine 4converting machine 5converting machine 6converting machine 7converting machine 8converting machine 9corrugator 1corrugator 2corrugator 3corrugator 4corrugator 5corrugator 6corrugator 7shipping 1shipping 2shipping 3shipping 4Powered 1Powered 2Powered 3Powered 4Powered 5Powered 6Powered 7Powered 8Powered 9combined 365
14ee last nameee first namestatussupervisorexpired
15 expired
16smithincompleteexpired
17smithexpired9/10/229/11/229/12/229/13/229/14/229/15/229/16/229/17/229/18/229/21/229/22/229/23/229/24/229/25/229/26/229/27/2210/2/2210/3/2210/4/2210/5/2210/13/2210/14/2210/13/2210/14/2210/13/2210/13/2210/13/22expired
18smithsaftey qualified2/1/232/2/232/3/232/4/232/5/232/6/232/7/232/8/232/9/232/12/232/13/232/14/232/15/232/16/232/17/232/18/232/23/232/24/232/25/232/26/233/6/233/7/233/9/233/10/233/12/233/12/233/12/23saftey qualified
Sheet1
Cell Formulas
RangeFormula
AX14:AX18AX14=LET(aem,TODAY()-MIN(E14:AM14,AO14:AP14,AR14:AT14),alam,TODAY()-MIN(AL14:AM14),aras,TODAY()-MIN(AR14:AS14),IF(OR(aem>365,AND(alam>1095,aras>1095)),"expired",IF(OR(AND(365>aem,aem>335),AND(AND(1095>alam,alam>1065),AND(1095>aras,aras>1065))),"expires soon",IF(AND(aem<335,AND(alam<1065,aras)),"saftey qualified",""))))
C15:C18C15=IF(A15="","",IF(CONCAT(E15:AT15)="","incomplete",IF(OR(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>365,AND(TODAY()-MIN(AL15:AM15)>1095,TODAY()-MIN(AR15:AS15)>1095)),"expired",IF(OR(AND(365>TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15),TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>335),AND(AND(1095>TODAY()-MIN(AL15:AM15),TODAY()-MIN(AL15:AM15)>1065),AND(1095>TODAY()-MIN(AR15:AS15),TODAY()-MIN(AR15:AS15)>1065))),"expires soon",IF(AND(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)<335,AND(TODAY()-MIN(AL15:AM15)<1065,TODAY()-MIN(AR15:AS15))),"saftey qualified","")))))
 
Upvote 0
I received #NAME? error.
which one did you use?
should be
Excel Formula:
=IF(A15="","",IF(CONCAT(E15:AT15)="","incomplete",IF(OR(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>365,AND(TODAY()-MIN(AL15:AM15)>1095,TODAY()-MIN(AR15:AS15)>1095)),"expired",IF(OR(AND(365>TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15),TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>335),AND(AND(1095>TODAY()-MIN(AL15:AM15),TODAY()-MIN(AL15:AM15)>1065),AND(1095>TODAY()-MIN(AR15:AS15),TODAY()-MIN(AR15:AS15)>1065))),"expires soon",IF(AND(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)<335,AND(TODAY()-MIN(AL15:AM15)<1065,TODAY()-MIN(AR15:AS15))),"saftey qualified","")))))
 
Upvote 0
which one did you use?
should be
Excel Formula:
=IF(A15="","",IF(CONCAT(E15:AT15)="","incomplete",IF(OR(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>365,AND(TODAY()-MIN(AL15:AM15)>1095,TODAY()-MIN(AR15:AS15)>1095)),"expired",IF(OR(AND(365>TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15),TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>335),AND(AND(1095>TODAY()-MIN(AL15:AM15),TODAY()-MIN(AL15:AM15)>1065),AND(1095>TODAY()-MIN(AR15:AS15),TODAY()-MIN(AR15:AS15)>1065))),"expires soon",IF(AND(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)<335,AND(TODAY()-MIN(AL15:AM15)<1065,TODAY()-MIN(AR15:AS15))),"saftey qualified","")))))
that's the one i used.

1694537826582.png
 
Upvote 0
Concat does not exist in 2016, it appeared with 2019.
 
Upvote 0
thanks @Fluff
try this instead
---------------
Excel Formula:
=IF(A15="","",IF(MAX(E15:AM15, AO15:AP15, AR15:AT15)=0,"incomplete",IF(OR(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>365,AND(TODAY()-MIN(AL15:AM15)>1095,TODAY()-MIN(AR15:AS15)>1095)),"expired",IF(OR(AND(365>TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15),TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>335),AND(AND(1095>TODAY()-MIN(AL15:AM15),TODAY()-MIN(AL15:AM15)>1065),AND(1095>TODAY()-MIN(AR15:AS15),TODAY()-MIN(AR15:AS15)>1065))),"expires soon",IF(AND(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)<335,AND(TODAY()-MIN(AL15:AM15)<1065,TODAY()-MIN(AR15:AS15))),"saftey qualified","")))))
 
Upvote 0
thanks @Fluff
try this instead
---------------
Excel Formula:
=IF(A15="","",IF(MAX(E15:AM15, AO15:AP15, AR15:AT15)=0,"incomplete",IF(OR(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>365,AND(TODAY()-MIN(AL15:AM15)>1095,TODAY()-MIN(AR15:AS15)>1095)),"expired",IF(OR(AND(365>TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15),TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)>335),AND(AND(1095>TODAY()-MIN(AL15:AM15),TODAY()-MIN(AL15:AM15)>1065),AND(1095>TODAY()-MIN(AR15:AS15),TODAY()-MIN(AR15:AS15)>1065))),"expires soon",IF(AND(TODAY()-MIN(E15:AM15,AO15:AP15,AR15:AT15)<335,AND(TODAY()-MIN(AL15:AM15)<1065,TODAY()-MIN(AR15:AS15))),"saftey qualified","")))))
I think it is getting closer. It's returning "expired" in the status cell when it should be "safety qualified" as none of the dates are in the expired range.

1694603173641.png
 
Upvote 0
can you provide some sample data with dates and expected outcomes for me to compare before submitting new formula?
suggest using xl2bb from link below
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,270
Members
449,149
Latest member
mwdbActuary

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