Calculate average gas prices by year in excel
- by ghostryder111
I have 3 columns, A=Date, B=Price, C=Grade in Excel. I want to calculate the average price of fuel for each year and an overall average of all years by grade.
The data table looks like this
Date | Price | Grade
2012-05-01 | $3.49 | Regular
2012-06-07 | $3.58 | Regular
2012-04-01 | $3.98 | Premium
2012-02-17 | $3.87 | Premium
2013-01-01 | $3.49 | Regular
2013-02-01 | $3.89 | Premium
2013-03-06 | $3.89 | Premium
2013-03-09 | $3.45 | Regular
The output should look something like this:
Year | Regular | Premium
2012 | 3.43 | 3.67
2013 | 3.45 | 3.73
All | 3.44 | 3.70