Google-sheets – Change Google Sheets displaying “0” for =Sum formulas

formulasgoogle sheets

I'm putting together a spreadsheet in Google Sheets to keep track of my nutrition and weight loss.

I want to make 2 charts, 1 that will display my weight over time and one that will display my calorie changes so I can compare the two. I have an issue with the calorie chart. On my tracker sheet I have columns I enter my protein fat and carb amounts and then the total calories get calculated using the formula below and entered in a separate cell.

=SUM(K12 * 4)+(L12 * 9)+(M12 * 4)

My problem is, these cells will always display a zero which messes up the look of the chart. I was wondering if there was a way I could use the SUM formula above or a different formula that would not automatically display a zero.

Best Answer

You can use this formula instead

=IF(K12="","",SUM(K12 * 4)+(L12 * 9)+(M12 * 4))

This formula says:
If cell K12 is empty, show empty. If not, show the result of SUM(K12 * 4)+(L12 * 9)+(M12 * 4))