+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : Using YEAR() of a range in AVERAGEIF

  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    Windsor, England
    MS-Off Ver
    Excel 2010
    Posts
    69

    Using YEAR() of a range in AVERAGEIF

    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!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using YEAR() of a range in AVERAGEIF

    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
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-04-2011
    Location
    Windsor, England
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Using YEAR() of a range in AVERAGEIF

    That's great, thank you for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1