How to write nested IF AND statements to find the criteria

Adit

New Member
Joined
Jul 8, 2023
Messages
15
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hello, I am trying to categorize data based on the days output, please see below. The required Output col should update based on the days value and criteria.

I have tried using nested IF AND however, it looks like I cannot resolve it. Any help will be highly appreciated.

My Try which I know is wrong :- =IF(AND(G5>35,G5<=21),"1 WEEK LATE",IF(AND(G5>42,G5<=14),"2 WEEKS LATE",IF(G5<=0,"Drop1 Date Wrong",IF(G5=28,"On Time","Too Late"))))

DaysRequired OutputCriteria
-21​
Wrong DateIf days <= 0 then Wrong Date
-14​
Wrong Dateif days = 28 then On time
-7​
Wrong DateIf days >=21 and days <= 35 then 1 week late
-6​
Wrong Dateif days >= 14 and days <=42 then 2 weeks late
0​
Wrong DateIf days >0 and days >42 then Too Late
7​
Too Late
13​
Too Late
14​
2 Weeks Late
15​
2 Weeks Late
20​
2 Weeks Late
21​
1 week late
22​
1 week late
24​
1 week late
28​
On Time
31​
1 week late
34​
1 week late
35​
1 week late
42​
2 weeks late
49​
Too Late
56​
Too Late
63​
Too Late
70​
Too Late
77​
Too Late
 
Last edited:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
AND(G5>35,G5<=21) means if the value in G5 both greater than 35 and less than or equal to 21 which does NOT make sense. I think you meant to say AND(G5<35,G5>=21).
You have the similar issue with AND(G5>42,G5<=14) as well.
 
Upvote 0
Try this:
Cell Formulas
RangeFormula
C3:C25C3=IFS(B3<=0,"Wrong Date", B3=28,"On Time",AND(B3>=21,B3<=35),"1 Week Late",AND(B3>=14,B3<=42),"2 Weeks Late",TRUE,"Too Late")
 
Upvote 1
Solution
Try this:
Cell Formulas
RangeFormula
C3:C25C3=IFS(B3<=0,"Wrong Date", B3=28,"On Time",AND(B3>=21,B3<=35),"1 Week Late",AND(B3>=14,B3<=42),"2 Weeks Late",TRUE,"Too Late")
Many thanks for your help :)
 
Upvote 0

Forum statistics

Threads
1,215,087
Messages
6,123,050
Members
449,092
Latest member
ikke

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