Google Sheets – SUM Function Not Working for Cells with Formulas

google sheets

A           B
----------------------
TOTAL       =SUM(B3:B)
Entry1      =IF($A3="Entry1","20",IF($A3="Entry2","170", IF($A3="Entry3","10")))
Entry2      =IF($A4="Entry1","20",IF($A4="Entry2","170", IF($A4="Entry3","10")))
Entry3      =IF($A5="Entry1","20",IF($A5="Entry2","170", IF($A5="Entry3","10")))

The values in column B are properly displayed (respectively "20", "170" and "10"). But the SUM function in B2 returns 0… why?

Best Answer

Just unquote your numbers like this:

=IF($A3="Entry1",20,IF($A3="Entry2",170, IF($A3="Entry3",10)))

Otherwise it treats the numbers like text.