# 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:

• 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.

Jason Tarpinian - Sevan Technology

Smartsheet Platinum Partner

• 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.

Jason Tarpinian - Sevan Technology

Smartsheet Platinum Partner

• 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!