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
 
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
I'll work on it.

If it helps, this is the formula used previously for E15:AK15.... then I added AL15:AT15 which had the different variable for number of days. You may be able to understand better with the dates on the screen grab.

=IF(A15="","",IF(MIN(E15:AK15)=0,"Incomplete",IF(MIN(E15:AK15)<TODAY()-365,"Expired",IF(MEDIAN(TODAY()-365,TODAY()-335,MIN(E15:AK15))=MIN(E15:AK15),"Expires Soon","Safety Qualified"))))

1694628459148.png
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
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
Machine Safety Qualification Tracker.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAY
1CONVERTING MACHINESCORRUGATORSHIPPING/BalerPowered Industrial Truck Training
210955376 Martin FFG2402 United RDC2423 Ward RDC2432 Ward RDC5104 Ward FFG5164 Ward FFG5014 LMC FFG1502 2pc StitcherTransfer CartsMachine Center NameMachine Center NameWet End (RS 7-10 & Trolleys, SF, Splicers)Wet End (RS 3-6 & Trolleys, SF, Splicers)Wet End (RS 1&2 & Trolleys, Trible Stack, Glue Machine)Dry End (DB thru Knife)Dry End (Knife thru Stacker)Corrugator PalletizerStarch RoomOtherOtherOtherOtherPalletizerCentering DeviceStretch WrapperBaler-HoggerOtherOtherOtherOtherOtherOtherOtherPIT Train the Trainer Certified (Expires every 3 years)Supervisor Class Room Training (Expires every 3 years)Operator Class Room Training, Test, & Practical Exercies (Does not expire as long as Annual Eval is completed every year)Fork Lift Annual EvaluationRoll Clamp Truck Annual EvaluationPull Pak Annual EvaluationBox Clamp Truck Annual EvaluationFork Lift Annual EvaluationStand Up Fork Lift Annual EvaluationOther Lift Annual EvaluationTruck Type CertificationsMEWP Train the Trainer Certified (Expires every 3 years)MEWP Class Room Training, Exam, & Practical EvaluationMEWP Annual Evaluation
3730 Qualified Machine Operators
4
5CONVERTING
6
7
8ONLY SAFETY QUALIFIED EMPLOYEES ARE ALLOWED TO WORK ON ASSIGNED MACHINES
9
10
11
12
13Remove employees by deleting the row. Add new employees at the bottom of the list.
14EE Last NameEE First NameStatusSupervisor
15 
16JaschobScottExpiredFLL05/19/2205/19/2202/04/21
17KrausStevenExpiredParkinson10/31/2208/29/22
18MuellerPaulExpiredFLL05/19/2205/19/2204/07/22
19SarauerKatrinaExpires SoonLaude10/13/22
20SupernandBradenExpires SoonParkinson10/13/2204/17/23
21Batterman-WoelfelShellyIncompleteBuchholz7/7/202005/17/2305/17/23Fork/Clamp
22SchaeferAllanIncompleteParkinson7/23/202005/19/23Fork
23AbholdDavidSafety QualifiedJaschob05/01/2311/08/22
24AbreschFredSafety QualifiedHalle02/02/232/17/202305/04/2305/04/23Fork/Clamp
25BaehlerJeffreySafety QualifiedParkinson06/20/23
MSQ Tracker
Cell Formulas
RangeFormula
C15,C19:C25,C17C15=IF(A15="","",IF(MIN(E15:AK15)=0,"Incomplete",IF(MIN(E15:AK15)<TODAY()-365,"Expired",IF(MEDIAN(TODAY()-365,TODAY()-335,MIN(E15:AK15))=MIN(E15:AK15),"Expires Soon","Safety Qualified"))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AL15:AM118,AW15:AW118Expression=ISBLANK(AL15)textNO
AL15:AM118,AW15:AW118Expression=AL15>TODAY()-$A$3textNO
AL15:AM118,AW15:AW118Expression=AL15<TODAY()-$A$2textNO
AL15:AM118,AW15:AW118Expression=AND(AL15<=TODAY()-$A$3)textNO
P15:Z118,AO15:AU118,AY15:AY118Expression=ISBLANK(P15)textNO
C15:C118Cell Valuecontains "Expires Soon"textNO
C15:C118Cell Valuecontains "Expired"textNO
C15:C118Cell Valuecontains "Safety Qualified"textNO
E15:O118,AA15:AK118Expression=ISBLANK(E15)textNO
E15:AK118,AO15:AU118,AY15:AY118Expression=E15>TODAY()-'Safety Qualificaton Elements'!$B$3textNO
E15:AK118,AO15:AU118,AY15:AY118Expression=E15<TODAY()-'Safety Qualificaton Elements'!$B$2textNO
E15:AK118,AO15:AU118,AY15:AY118Expression=AND(E15<=TODAY()-'Safety Qualificaton Elements'!$B$3,E15>=TODAY()-'Safety Qualificaton Elements'!$B$2)textNO
Cells with Data Validation
CellAllowCriteria
AO15:AU25Date<='Safety Qualificaton Elements'!$B$4
AW15:AW25Date<='Safety Qualificaton Elements'!$B$4
AY15:AY25Date<='Safety Qualificaton Elements'!$B$4
AA15:AM25Date<='Safety Qualificaton Elements'!$B$4
E15:V25Date<='Safety Qualificaton Elements'!$B$4


Cells A15:AK15 has the formula as needed for that range, however, I'm looking to add AL:AY with the different number of days. I appreciate your help.

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:AK15, AO15:AU15, and AY15 has a date over 365 days prior to today or If AL15:AM15 and AW15, 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:AK15, AO15:AU15, and AY15 has a date between 335-365 days prior to today or If AL15:AM15 and AW15 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:AU15, and AY15 has all dates within 335 days prior to today and IF AL15:AM15 and AW15 has all dates within 1065, "Safety Qualified"

Columns AN, AV, & AX will not be part of the formula.
 
Upvote 0
try the last column
---------------
Nested If with dates & multiple day variables.xlsx
ABCDEFGHIJKLMNOAAABACADAEAFAGAHAIAJAKAZBABB
1CONVERTING MACHINESSHIPPING/Baler36520192016
14EE Last NameEE First NameStatusSupervisor
15    
16JaschobScottExpiredFLL5/19/2022expiredexpiredexpired
17KrausStevenExpiredParkinson10/31/20228/29/2022expiredexpiredexpired
18MuellerPaulExpiredFLL5/19/2022expiredexpiredexpired
19SarauerKatrinaExpires SoonLaude10/13/2022expires soonexpires soonexpires soon
20SupernandBradenExpires SoonParkinson10/13/20224/17/2023expires soonexpires soonexpires soon
21Batterman-WoelfelShellyIncompleteBuchholzsafety qualifiedsafety qualifiedsafety qualified
22SchaeferAllanIncompleteParkinsonsafety qualifiedsafety qualifiedsafety qualified
23AbholdDavidSafety QualifiedJaschob5/1/202311/8/2022safety qualifiedsafety qualifiedsafety qualified
24AbreschFredSafety QualifiedHallesafety qualifiedsafety qualifiedsafety qualified
25BaehlerJeffreySafety QualifiedParkinson6/20/2023safety qualifiedsafety qualifiedsafety qualified
Sheet1 (2)
Cell Formulas
RangeFormula
C15,C19:C25,C17C15=IF(A15="","",IF(MIN(E15:AK15)=0,"Incomplete",IF(MIN(E15:AK15)<TODAY()-365,"Expired",IF(MEDIAN(TODAY()-365,TODAY()-335,MIN(E15:AK15))=MIN(E15:AK15),"Expires Soon","Safety Qualified"))))
AZ15:AZ25AZ15=LET(aa,MIN(E15:AK15,AO15:AU15,AY15),bb,AGGREGATE(15,6,AL15:AM15),IF(A15="","",IF(CONCAT(E15:AM15, AO15:AP15, AR15:AT15)="","incomplete",IF(OR(TODAY()-aa>365,IFERROR(OR(TODAY()-bb>1095,TODAY()-AGGREGATE(15,6,AW15)>1095),FALSE)),"expired",IF(OR( AND(TODAY()-aa<365,TODAY()-aa>335),AND(IFERROR(OR(TODAY()-bb<1095,TODAY()-bb>1065),FALSE),OR(TODAY()-AW15<1095,TODAY()-AW15>1065))),"expires soon","safety qualified")))))
BA15:BA25BA15=IF(A15="","",IF(CONCAT(E15:AM15, AO15:AP15, AR15:AT15)="","incomplete", IF(OR(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>365,IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)>1095,TODAY()-AGGREGATE(15,6,AW15)>1095),FALSE)),"expired", IF(OR( AND(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)<365,TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>335), AND(IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)<1095,TODAY()-AGGREGATE(15,6,AL15:AM15)>1065),FALSE),OR(TODAY()-AW15<1095,TODAY()-AW15>1065))),"expires soon", "safety qualified"))))
BB15:BB25BB15=IF(A15="","",IF(MAX(E15:AM15, AO15:AP15, AP15:AR15)=0,"incomplete", IF(OR(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>365,IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)>1095,TODAY()-AGGREGATE(15,6,AW15)>1095),FALSE)),"expired", IF(OR( AND(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)<365,TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>335), AND(IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)<1095,TODAY()-AGGREGATE(15,6,AL15:AM15)>1065),FALSE),OR(TODAY()-AW15<1095,TODAY()-AW15>1065))),"expires soon", "safety qualified"))))
 
Upvote 0
try the last column
---------------
Nested If with dates & multiple day variables.xlsx
ABCDEFGHIJKLMNOAAABACADAEAFAGAHAIAJAKAZBABB
1CONVERTING MACHINESSHIPPING/Baler36520192016
14EE Last NameEE First NameStatusSupervisor
15    
16JaschobScottExpiredFLL5/19/2022expiredexpiredexpired
17KrausStevenExpiredParkinson10/31/20228/29/2022expiredexpiredexpired
18MuellerPaulExpiredFLL5/19/2022expiredexpiredexpired
19SarauerKatrinaExpires SoonLaude10/13/2022expires soonexpires soonexpires soon
20SupernandBradenExpires SoonParkinson10/13/20224/17/2023expires soonexpires soonexpires soon
21Batterman-WoelfelShellyIncompleteBuchholzsafety qualifiedsafety qualifiedsafety qualified
22SchaeferAllanIncompleteParkinsonsafety qualifiedsafety qualifiedsafety qualified
23AbholdDavidSafety QualifiedJaschob5/1/202311/8/2022safety qualifiedsafety qualifiedsafety qualified
24AbreschFredSafety QualifiedHallesafety qualifiedsafety qualifiedsafety qualified
25BaehlerJeffreySafety QualifiedParkinson6/20/2023safety qualifiedsafety qualifiedsafety qualified
Sheet1 (2)
Cell Formulas
RangeFormula
C15,C19:C25,C17C15=IF(A15="","",IF(MIN(E15:AK15)=0,"Incomplete",IF(MIN(E15:AK15)<TODAY()-365,"Expired",IF(MEDIAN(TODAY()-365,TODAY()-335,MIN(E15:AK15))=MIN(E15:AK15),"Expires Soon","Safety Qualified"))))
AZ15:AZ25AZ15=LET(aa,MIN(E15:AK15,AO15:AU15,AY15),bb,AGGREGATE(15,6,AL15:AM15),IF(A15="","",IF(CONCAT(E15:AM15, AO15:AP15, AR15:AT15)="","incomplete",IF(OR(TODAY()-aa>365,IFERROR(OR(TODAY()-bb>1095,TODAY()-AGGREGATE(15,6,AW15)>1095),FALSE)),"expired",IF(OR( AND(TODAY()-aa<365,TODAY()-aa>335),AND(IFERROR(OR(TODAY()-bb<1095,TODAY()-bb>1065),FALSE),OR(TODAY()-AW15<1095,TODAY()-AW15>1065))),"expires soon","safety qualified")))))
BA15:BA25BA15=IF(A15="","",IF(CONCAT(E15:AM15, AO15:AP15, AR15:AT15)="","incomplete", IF(OR(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>365,IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)>1095,TODAY()-AGGREGATE(15,6,AW15)>1095),FALSE)),"expired", IF(OR( AND(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)<365,TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>335), AND(IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)<1095,TODAY()-AGGREGATE(15,6,AL15:AM15)>1065),FALSE),OR(TODAY()-AW15<1095,TODAY()-AW15>1065))),"expires soon", "safety qualified"))))
BB15:BB25BB15=IF(A15="","",IF(MAX(E15:AM15, AO15:AP15, AP15:AR15)=0,"incomplete", IF(OR(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>365,IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)>1095,TODAY()-AGGREGATE(15,6,AW15)>1095),FALSE)),"expired", IF(OR( AND(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)<365,TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>335), AND(IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)<1095,TODAY()-AGGREGATE(15,6,AL15:AM15)>1065),FALSE),OR(TODAY()-AW15<1095,TODAY()-AW15>1065))),"expires soon", "safety qualified"))))

Thank you! Just taken a quick look at it, it looks like that is what I need!
 
Upvote 0
awesome, glad could help
consider marking it as a solution for others to find
 
Upvote 0
awesome, glad could help
consider marking it as a solution for others to find
Machine Safety Qualification Tracker.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAY
1CONVERTING MACHINESCORRUGATORSHIPPING/BalerPowered Industrial Truck Training
210955376 Martin FFG2402 United RDC2423 Ward RDC2432 Ward RDC5104 Ward FFG5164 Ward FFG5014 LMC FFG1502 2pc StitcherTransfer CartsMachine Center NameMachine Center NameWet End (RS 7-10 & Trolleys, SF, Splicers)Wet End (RS 3-6 & Trolleys, SF, Splicers)Wet End (RS 1&2 & Trolleys, Trible Stack, Glue Machine)Dry End (DB thru Knife)Dry End (Knife thru Stacker)Corrugator PalletizerStarch RoomOtherOtherOtherOtherPalletizerCentering DeviceStretch WrapperBaler-HoggerOtherOtherOtherOtherOtherOtherOtherPIT Train the Trainer Certified (Expires every 3 years)Supervisor Class Room Training (Expires every 3 years)Operator Class Room Training, Test, & Practical Exercies (Does not expire as long as Annual Eval is completed every year)Fork Lift Annual EvaluationRoll Clamp Truck Annual EvaluationPull Pak Annual EvaluationBox Clamp Truck Annual EvaluationFork Lift Annual EvaluationStand Up Fork Lift Annual EvaluationOther Lift Annual EvaluationTruck Type CertificationsMEWP Train the Trainer Certified (Expires every 3 years)MEWP Class Room Training, Exam, & Practical EvaluationMEWP Annual Evaluation
3730 Qualified Machine Operators
4
5CONVERTING
6
7
8ONLY SAFETY QUALIFIED EMPLOYEES ARE ALLOWED TO WORK ON ASSIGNED MACHINES
9
10
11
12
13Remove employees by deleting the row. Add new employees at the bottom of the list.
14EE Last NameEE First NameStatusSupervisor
15AbholdDavidSafety QualifiedJaschob05/01/2311/08/2209/23/21
16AbreschFredSafety QualifiedHalle02/02/2309/21/202/17/202305/04/2305/04/23Fork/Clamp
17BaehlerJeffreySafety QualifiedParkinson06/20/2309/30/20
MSQ Tracker
Cell Formulas
RangeFormula
C15:C17C15=IF(A15="","",IF(MAX(E15:AM15, AO15:AP15, AP15:AR15)=0,"Incomplete", IF(OR(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>365,IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)>1095,TODAY()-AGGREGATE(15,6,AW15)>1095),FALSE)),"Expired", IF(OR( AND(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)<365,TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>335), AND(IFERROR(OR(TODAY()-AGGREGATE(15,6,AL15:AM15)<1095,TODAY()-AGGREGATE(15,6,AL15:AM15)>1065),FALSE),OR(TODAY()-AW15<1095,TODAY()-AW15>1065))),"Expires Soon", "Safety Qualified"))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AL15:AM655,AW15:AW655Expression=ISBLANK(AL15)textNO
AL15:AM655,AW15:AW655Expression=AL15>TODAY()-$A$3textNO
AL15:AM655,AW15:AW655Expression=AL15<TODAY()-$A$2textNO
AL15:AM655,AW15:AW655Expression=AND(AL15<=TODAY()-$A$3)textNO
P15:Z655,AO15:AU655,AY15:AY655Expression=ISBLANK(P15)textNO
C15:C655Cell Valuecontains "Expires Soon"textNO
C15:C655Cell Valuecontains "Expired"textNO
C15:C655Cell Valuecontains "Safety Qualified"textNO
E15:O655,AA15:AK655Expression=ISBLANK(E15)textNO
E15:AK655,AO15:AU655,AY15:AY655Expression=E15>TODAY()-'Safety Qualificaton Elements'!$B$3textNO
E15:AK655,AO15:AU655,AY15:AY655Expression=E15<TODAY()-'Safety Qualificaton Elements'!$B$2textNO
E15:AK655,AO15:AU655,AY15:AY655Expression=AND(E15<=TODAY()-'Safety Qualificaton Elements'!$B$3,E15>=TODAY()-'Safety Qualificaton Elements'!$B$2)textNO
Cells with Data Validation
CellAllowCriteria
AO15:AU17Date<='Safety Qualificaton Elements'!$B$4
AW15:AW17Date<='Safety Qualificaton Elements'!$B$4
AY15:AY17Date<='Safety Qualificaton Elements'!$B$4
E15:AM17Date<='Safety Qualificaton Elements'!$B$4


Still having an issue with AL,AM, & AW changing the status to "epired" or "expires soon". In cells AM16 and AM17 I put in dates that should be returning "expired" and "expires soon" in C16 and C17 respectively.
 
Upvote 0
@ExceLoki do You think this is doable? Otherwise, I could insert another column to the right of column C for the 3-year requirements?
 
Upvote 0
sorry for slow reply, been tinkering with this in between projects at work. think i've almost got it though...
 
Upvote 0
try this
Excel Formula:
=IF(A15="","",IF(MAX(E15:AM15, AO15:AP15, AP15:AR15)=0,"incomplete",IF(OR(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>365,OR(TODAY()-AGGREGATE(5,6,AL15:AM15)>1095,IFERROR(TODAY()-AGGREGATE(5,6,MIN(IF(ISNUMBER(AW15),IF(AW15>0,AW15),"p")))>1095,FALSE))),"expired",IF(OR(AND(TODAY()-MIN(E15:AK15,AO15:AU15,AY15)<365,TODAY()-MIN(E15:AK15,AO15:AU15,AY15)>335),OR(IFERROR(AND(TODAY()-AGGREGATE(5,6,AL15:AM15)<1095,TODAY()-AGGREGATE(5,6,AL15:AM15)>1065),FALSE),OR(IFERROR(TODAY()-AGGREGATE(5,6,MIN(IF(ISNUMBER(AW15),IF(AW15>0,AW15),"p")))<1095,FALSE),IFERROR(TODAY()-AGGREGATE(5,6,MIN(IF(ISNUMBER(AW15),IF(AW15>0,AW15),"p")))>1065,FALSE)))),"expires soon","safety qualified"))))
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

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