# I need help writing a formula.

Logic

if cell b >0, then calculate the Sum Cell b-cell a

• You would need to add another column to be able to make that calculation.

=IF([ColA]@row > 0, [ColB]@row - [ColA]@row, 0)

If ColA is <=0 then it will return 0

(change "ColA" and "ColB" to your actual column names)

Hope this helps!

• It gave me back #Circular Reference

this is the formula I made

=IF(May@row > 0, April@row - May@row, 0)

It did not change if I put the row name in brackets [ ]

• Are you putting the formula into the May or April row?

• Which column are you pasting this formula into? Sounds like you're executing this formula in cell b if you're getting a circular reference. This formula won't work in cell/column b because it's the cell being evaluated and written to.

• Yes I do get a circular reference. What I want to do if possible is if the month = \$0 leave it as \$0. but if the month is greater than \$0 then take that amount and subtract it from the previous months amount to get the difference.

• You would need to add another column to be able to make that calculation.

• I believe once you reference that other column from the May (cell b) column, your circular reference error will return.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!