I figured it out, and it's quite odd. I always thought that cell formats were mere presentation matters that didn't change the underlying data. It turns out that Pages copies one of Excel's botches, which is that functions like SUM() return 0 for cells that are formatted as, say, Automatic or Text rather than as Number. That is, a cell is treated as 0 unless the cell is formatted as a Number, even though the cell's actual data is numeric! Interestingly, in Pages once you have change to formatting to Number, SUM() keeps working even if you change the formatting back to Automatic (but not Text).