I am trying to add a calculation formula into a cell (which I am able to get it to work great), but I want the cell to email blank if the result of that calculation is zero.
Here is my formula that works:
=SUM([Weight]*[Price]+[Added])But how do I add a formula to that one? How do I make it not display a zero if the result is zero?
2 Answers
You can do this with a formula:
=IF(SUM([Weight]*[Price]+[Added])=0,"",SUM([Weight]*[Price]+[Added]))
or by using a custom format for the cells containing your results. Type "General;General;;@" (without the quotes) in the Custom Format dialog as shown below:
This latter approach is good if you might need to do more math on the result in the cell. The formula converts the cell to a text value equal to blank (""). If you try to add or multiply that cell, you'll get an error.
The custom format will still allow arithmetic operations on the result.
If you want it to do another decision you can nest formulas together.
You start with:
=SUM([Weight]*[Price]+[Added])so to do something else if that calculation is blank you can do something like this:
=if(SUM([Weight]*[Price]+[Added])=0, "do whatever when equal to 0", SUM([Weight]*[Price]+[Added]))IF your desire is for it to be blank if the calculation = 0 then replace "do whatever when equal to 0" with ""