Calculate average in Excel 2010 per month of the year

We are trying to calculate the average of each months of the years using the formula "=AVERAGE".  Unfortunately, it's not working.  We tried also "=SUMPRODUCT" but can't seem to get it accomplish.

In the included excel, notice that the formula displays and next to it what we calculate manually (see pic):

Please advice on the formula to use.

Thank you in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun KlineLead Software EngineerCommented:
Try this array formula for Jan 2015 TOP:
=AVERAGE(IF(MONTH($B$7:$B$161) = MONTH($B$3), IF(C7:C161<>"", C7:C161)))

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Saqib Husain, SyedEngineerCommented:
rayluvsAuthor Commented:
Yes Thanx !!!
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

rayluvsAuthor Commented:

We know we closed the question, but when transferring the formula to our real-working excel, it doesn't calculate correctly.  The reason is that the sample excel we provided only had data of 2015 and the real-life excel has data since 2007.   So the formula takes in account the month of all year; hence, wrong value.

How can we fix it to only read months of year 2015.

Notice below when entering data of 2009, the results are wrong for January 2015:

Shaun KlineLead Software EngineerCommented:
Using my answer:
=AVERAGE(IF(MONTH($B$7:$B$161) = MONTH($B$3), IF(YEAR($B$7:$B$161) = YEAR($B$3), IF(C7:C161<>"", C7:C161))))

Using Syed's answer:
rayluvsAuthor Commented:
Thanx Worked!!!
Rob HensonFinance AnalystCommented:
You could have also used a Pivot Table with Values calculated as Average.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.