+ Reply to Thread
Results 1 to 3 of 3

Average All Values Returned by Index?

  1. #1
    Registered User
    Join Date
    03-23-2010
    Location
    USA
    MS-Off Ver
    Excel 2004
    Posts
    5

    Average All Values Returned by Index?

    Hi! I'm still pretty new at Excel, and I have a big set of data that is organized (among other ways) by day of the week. I'd like to get the average value for each day of the week (so, the average of all Mondays, the average of all Tuesdays, etc. etc.) I thought that something like this:

    =AVERAGE(INDEX(B:C,MATCH("Monday",C:C,FALSE),1))

    would do it (the data is in the column before the day of the week), repeated for each day, but this only returns the first value that the function finds. Is there a way to get all of the values, so it can be averaged?

    Thanks, and please let me know if you need more information in order to help!

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Average All Values Returned by Index?

    Hi,

    How about this?

    =SUMIF(C1:C10000,"Monday",B1:B1000)/COUNTIF(C1:C10000,"Monday")

    As an aside, where you have FALSE in your match statement, you should really have 0, 1, or -1.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    03-23-2010
    Location
    USA
    MS-Off Ver
    Excel 2004
    Posts
    5

    Re: Average All Values Returned by Index?

    Cool, thanks! I changed it a bit, with further research (coz I have some days of the week without data yet) to be:

    =SUMIF(C2:C113,"Monday",B2:B113)/SUMPRODUCT(--(B2:B10000>0),--(C2:C10000="Monday"))

    But it works great. Thanks 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