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

  • Toufong Vang
    Toufong Vang ✭✭✭✭✭
    edited 01/18/23 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"))

    https://help.smartsheet.com/function/if

Answers

  • Toufong Vang
    Toufong Vang ✭✭✭✭✭
    edited 01/18/23 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"))

    https://help.smartsheet.com/function/if

  • J Hogan
    J Hogan ✭✭

    Thank you!! This worked.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!