Sum function sometimes returns erroneous result. Simple copy and paste solves the problem. What is going on and how can it be fixed?

I created a worksheet to sum amounts from different months into the total for the year. However, as I updated the worksheet, the Sum function returned erroneous totals. I could get the totals correct by copying and pasting the formula for the sum but I thought the software should handle this problem and automatically update it. Is this a glitch in the program?

Without a sample spreadsheet, looks difficult that someone can help?