Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

Nested IF statements

Can anyone assist me in where I am going wrong?

=IF([GEAR.]@row = true, [C/N SQD]@row, IF(LTG@row = true, [C/N LIGHTING]@row), IF(AND([GEAR.]@row = true, LTG@row = true) = true, [PROJECT TOTAL]@row))


If checkbox1 = true, set value to cell 1, if checkbox2 = true, set value to cell2, if BOTH checkboxes = true, set value to cell 3 (I would like to sum two cells together, but I just made another column that does the summing for me ahead of time.

Tags:

Best Answer

  • Community Champion
    edited 01/12/21 Answer ✓

    You will have to check your IF(AND( statement first. The way you have it currently, if both boxes are checked, the logic would stop at the first statement because box 1 is checked, and not even check the logic on box 2. So you almost have it, just shift the IF(AND( combo as the first step in the logic:

    =IF(AND([GEAR.]@row = true, LTG@row = true), [PROJECT TOTAL]@row, IF([GEAR.]@row = true, [C/N SQD]@row, IF(LTG@row = true, [C/N LIGHTING]@row, "No Match")))

    Where "No Match" would be the result if nothing is checked.

Answers

  • Community Champion
    edited 01/12/21 Answer ✓

    You will have to check your IF(AND( statement first. The way you have it currently, if both boxes are checked, the logic would stop at the first statement because box 1 is checked, and not even check the logic on box 2. So you almost have it, just shift the IF(AND( combo as the first step in the logic:

    =IF(AND([GEAR.]@row = true, LTG@row = true), [PROJECT TOTAL]@row, IF([GEAR.]@row = true, [C/N SQD]@row, IF(LTG@row = true, [C/N LIGHTING]@row, "No Match")))

    Where "No Match" would be the result if nothing is checked.

  • That makes sense. I didn't think about it logically enough. That did the trick though!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions