Apologies if this has already been asked, I couldn't find anything similar on the forum.
I basically have a table of dates (jan 2012, feb 2012, mar 2012....etc etc to dec 2050) and production for each of those months.
I want to produce a cell (say B1) which the user can type in a year (in A1) and it gives average production for that year.
I was trying to use B1=AVERAGEIF(YEAR(Range of dates),A1,range of productions)
This doesn't work, can anyone offer me any advice?
Thanks,
Alice
Last edited by qaliq; 11-01-2011 at 09:16 AM. Reason: Solved!
Try:
=AVERAGE(IF(YEAR(Range of dates)=A1,range of productions))
confirmed with CTRL+SHIFT+ENTER
or
=AVERAGEIFS(Rangeofproductions,Rangeofdates,">="&DATE(A1,1,1),Rangeofdates,"<="&DATE(A1,12,31))
confirmed with ENTER
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
That's great, thank you for your help!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks