Column names that are data
If your columns are jan, feb, mar, the month is a value hiding in a name. Any code that adds a month breaks, and any code that averages across columns averages the wrong thing. Melt those columns into a month field.
Missing cells need a rule
A grid with gaps has cells that do not exist. Decide whether absent means zero or unknown, and fill the grid consistently. The two answers give different totals, and the difference is usually the whole bug.