Combining 2 IF statements
I have 2 valid IF statements but I would like to combine them so the value from either statement is returned in one cell. Below are the 2 statements
=IF([New Priority]@row >= 14, "Level 1", IF([New Priority]@row <= 9, "Level 3")
=IF(AND([New Priority]@row >= 10, [New Priority]@row <= 13), "Level 2")
Best Answer
-
Hi, @J Hogan, if you include all parts (full syntax) of the IF() expression in your first formula and layout the formula like below...
= IF([New Priority]@row >= 14 , "Level 1" , IF([New Priority]@row <= 9 , "Level 3" , "xxxx" ) )
...then you can substitute your second formula/expression for the "xxxx" resulting in...
= IF([New Priority]@row >= 14, "Level 1", IF([New Priority]@row <= 9, "Level 3", IF(AND([New Priority]@row >= 10, [New Priority]@row <= 13), "Level 2")))
However, you needn't do this since... If "New Priority" is not ≥ 14 AND it is not ≤ 9, that is to say, "New Priority" is between 9 and 14, then it's a "Level 2". For this, simply replace "xxxx" with "Level 2".
= IF([New Priority]@row >= 14 , "Level 1" , IF([New Priority]@row <= 9 , "Level 3" , "Level 2" ) )
Collapsed, your shortened formula would be,
= IF([New Priority]@row >= 14, "Level 1", IF([New Priority]@row <= 9, "Level 3", "Level 2"))
Answers
-
Hi, @J Hogan, if you include all parts (full syntax) of the IF() expression in your first formula and layout the formula like below...
= IF([New Priority]@row >= 14 , "Level 1" , IF([New Priority]@row <= 9 , "Level 3" , "xxxx" ) )
...then you can substitute your second formula/expression for the "xxxx" resulting in...
= IF([New Priority]@row >= 14, "Level 1", IF([New Priority]@row <= 9, "Level 3", IF(AND([New Priority]@row >= 10, [New Priority]@row <= 13), "Level 2")))
However, you needn't do this since... If "New Priority" is not ≥ 14 AND it is not ≤ 9, that is to say, "New Priority" is between 9 and 14, then it's a "Level 2". For this, simply replace "xxxx" with "Level 2".
= IF([New Priority]@row >= 14 , "Level 1" , IF([New Priority]@row <= 9 , "Level 3" , "Level 2" ) )
Collapsed, your shortened formula would be,
= IF([New Priority]@row >= 14, "Level 1", IF([New Priority]@row <= 9, "Level 3", "Level 2"))
-
Thank you!! This worked.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.5K Get Help
- 424 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 145 Just for fun
- 62 Community Job Board
- 465 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!