# Help with Nested IF AND Statement

Copper Contributor

# Help with Nested IF AND Statement

Hello,
My team and I have been working on logic for a report, but we cannot get it to work accurately across all criteria that we need it for.
Here's the logic that we need to include:
1. If Column AP is "CPU", and Column AE is <= Column AD, return "Green"
2. If Column AP is "CPU," and Column AE is "", and Column AD is within 3 days of today, return "Yellow"
3. If Column AP is "CPU," and Column AE is "", and Column AD is < today, return "Red"
4. If Column AP is "CPU", and Column AE is > Column AD, return "Red"
5. If Column AP is not "CPU", and Column AE is <= Column AD, return "Green"
6. If Column AP is not "CPU", and Column AE is "", and Column AN is within 3 days of today, return "Yellow"
7. If Column AP is not "CPU", and Column AE is "", and Column AN is < today, return "Red"
8. If Column AP is not "CPU", and Column AE is >Column AD, return "Red"

If anyone is able to assist, we would be very grateful!

2 Replies

# Re: Help with Nested IF AND Statement

=IF(AP2="CPU", IF(AE2="", IF(AD2<TODAY(), "RED", IF(AD2<TODAY()+3, "YELLOW", "RED")), IF(AE2<=AD2, "GREEN", "RED")), IF(AE2="", IF(AN2<TODAY(), "RED", IF(AN2<TODAY()+3, "YELLOW", "RED")), IF(AE2<=AD2, "GREEN", "RED")))

Or

=IF(AE2="", IF(IF(AP2="CPU", AD2, AN2)<TODAY(), "RED", IF(IF(AP2="CPU", AD2, AN2)<TODAY()+3, "YELLOW", "RED")), IF(AE2<=AD2, "GREEN", "RED"))

# Re: Help with Nested IF AND Statement

That worked! Thank you so much!!