Calculate average gas prices by year in excel

Posted by ghostryder111 on Super User See other posts from Super User or by ghostryder111
Published on 2014-06-12T22:40:10Z Indexed on 2014/06/13 3:29 UTC
Read the original article Hit count: 185

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 

© Super User or respective owner

Related posts about microsoft-excel

Related posts about worksheet-function