+ Reply to Thread
Results 1 to 6 of 6

Taking average instead of SUMPRODUCT

  1. #1
    Registered User
    Join Date
    04-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    86

    Taking average instead of SUMPRODUCT

    Hi Guys -

    I've used this formula on my spreadsheet:

    Please Login or Register  to view this content.
    ... and it works great, summing cells only for a selected month and year.

    However, if I wished instead to take the average of cells for a month and year, instead of summing them, how would this be done?

    Many thanks,

    John
    Last edited by john_london; 07-30-2012 at 01:05 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Taking average instead of SUMPRODUCT

    Hi john,

    How about dividing the sum by the count? If you showed us a sample workbook it might be easier to explain. The general idea is to do your formula above and then divide that result by CountIfs( <the same criteria used in the SumProduct>).

    I hope that makes sense.

    I'm a Pivot Table guy and thing if your data is in a table you could do a Pivot Table with a filter and easily get Average instead of Sum.

    You can attach a sample workbook by clicking n "Go Advanced" and then the Paper Clip Icon above the advanced message area. Then I could see if a Pivot Table answer is easy or not.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Taking average instead of SUMPRODUCT

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Does that work for you?
    With Excel 2007, you could also use AVERAGEIFS if you don't need to be compatable with 2003
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor day92's Avatar
    Join Date
    04-20-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 360
    Posts
    600

    Re: Taking average instead of SUMPRODUCT

    Or you can use an array with a shorter formula..

    =AVERAGE(IF((YEAR(Sheet2!$A3:$A72)=$G$7)*(MONTH(Sheet2!$A3:$A72)=$J$6),Sheet2!$F3:$F72))

    Confirm with Ctrl, shift enter

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Taking average instead of SUMPRODUCT

    As you have Excel 2007 you can use AVERAGEIFS function which doesn't require "array entry", i.e.

    =AVERAGEIFS(Sheet2!$F3:$F72,Sheet2!$A3:$A72,">="&DATE($G$7,$J$6,1),Sheet2!$A3:$A72,"<"& DATE($G$7,$J$6+1,1))
    Audere est facere

  6. #6
    Registered User
    Join Date
    04-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Taking average instead of SUMPRODUCT

    IT WORKS!!!! Thanks so much!

+ 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