Average of a set of numbers, excluding empty cells (but including cells with a value of zero)
Hi, I have two tables in my spreadsheet (a personal budget) showing all my expenses spread over time. In the first table, each column is a month and year, each row is a type of expense (gas, rent, groceries, etc).
| October 2013 | November 2013 | December 2013 | February 2014 |
|---|---|---|---|
| Income | 3000.00 | 3200.00 | 2800.00 |
| Gas | 85.00 | 95.00 | 75.00 |
| Rent | 1200.00 | 1200.00 | 1200.00 |
| Groceries | 110.00 | 130.00 | 150.00 |
| Eating Out | 92.00 | 76.00 | 80.00 |
| Clothes | 0.00 | 90.00 | 30.00 |
The second table is this month's expenses so far (I enter the figures for "X Month, So Far" in a third table, which doesn't factor in here).
| December 2013, So Far | Average +/- | |
|---|---|---|
| Income | 2800.00 | -200.00 |
| Gas | 75.00 | -15.00 |
| Rent | 1200.00 | 0 |
| Groceries | 150.00 | +30.00 |
| Eating Out | 80.00 | -4.00 |
| Clothes | 30.00 | -15.00 |
I want the correct formula for the Average +/- column. I want it to calculate the monthly average for that particular type of expense, and then calculate the difference from this month's expenses so far. The key is that I want it to add all the sums from a particular row with any value in their cells, even if it's zero. For instance, all of the examples above would divide the sums by two - even the row for Clothes, which has a cell with 0.00, but I would need that to count as a value.
Also, when calculating the average, I would want the formula to exclude the current month, which is entered automatically in the next column.
I would need a formula I wouldn't have to change every month. Can you help?
iWork Numbers-OTHER