Kyle
Kyle

Reputation: 37

Excel Nested IF AND formula

I can't tell why I'm getting an error with the below formula:

=IF(AND(AL=AM, AK=TRUE), "Unchanged, " ", IF(AND(AL>AM, AK=TRUE), "Downgrade", " ", IF(AND(AL<AM, AK=TRUE), "Upgrade, " ")))

Columns AL and AM contain values 0-4. Column AK contains True/false. If the conditions are met I want to insert the text string. If they are not met, I want to insert the single space to leave the cell blank.

Thank you!

Upvotes: 0

Views: 103

Answers (2)

Wyatt Shipman
Wyatt Shipman

Reputation: 1789

You don't need the " " after each of the text strings. The formula wasn't working because you were trying to define 4 parameters in each if statement. removing the ," " should fix this.

=IF(AND(AL=AM, AK=TRUE), "Unchanged, IF(AND(AL>AM, AK=TRUE), "Downgrade", IF(AND(AL<AM, AK=TRUE), "Upgrade, " ")))

Upvotes: 1

Scott Craner
Scott Craner

Reputation: 152605

You need to put the nested IFs in the False of the previous:

=IF(AND(AL1=AM1, AK1), "Unchanged", IF(AND(AL1>AM1, AK1), "Downgrade", IF(AND(AL1<AM1, AK), "Upgrade", " ")))

Another method with out the AND():

IF(AK1,IF(L1=AM1,"Unchanged",IF(L1>AM1,"Downgrade",IF(L1<AM1,"Upgrade",""))),"")

Upvotes: 2

Related Questions