Zend certified PHP/Magento developer

Average SumIf, differentiate between Zero and Blank

I need some help from the almighty community here.

I have a sample set of data here. I am trying to sumif some data and then average it. the goal being to get a running average of my budget but only take into account months that have happened already.

For example, I use “Spending” in the spreadsheet, but it could be anything: Gas, Home Improvement, etc. Say in January I spend $600 on Spending well then my average for the year is $600. But then say in February I spend nothing on Spending, then my average is $300. My problem, I seem to only be able to get an average for all months regardless if they happened, so it currently is the month of February, March – December get taken into account in the average because they all have blank numbers, resulting in an inaccurate average. What I want is for it to calculate the average as the months go on.

The only other caveat, is I use categories in my spreadsheet, in my example I have Spending category and then a notes column for what I spent it on. This is because I do category averages and totals at the end of the year and I like to know what each item was.

I tried using “” to distinguish between Blanks and 0s, but if you try to average “”, its text and i get an error. See in Cell M5. M5 is where I am trying to get 900 as the average because January and February have happened but December has not.

Example Spreadsheet