+ Reply to Thread
Results 1 to 5 of 5

Adding up averages after checking another column

  1. #1
    Forum Contributor
    Join Date
    09-23-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    346

    Adding up averages after checking another column

    Evening,

    I am using this formula:

    =AVERAGE('Input Sheet'!H:H)

    To work out the average value in column H.

    However, I now need to be more selective:

    - I only want to work out the average of the cells in H, if the value in column E is the same value as in A8, A9, A10, A11 or A12.

    Thanks for any help you can give.
    Last edited by Cmorgan; 09-19-2011 at 03:47 PM.

  2. #2
    Forum Contributor
    Join Date
    01-14-2004
    Location
    India
    MS-Off Ver
    365
    Posts
    264

    Re: Adding up averages after checking another column

    Try this
    =IF(E1=A8+A9+A10+A11+A12,AVERAGE('Input Sheet'!H:H),"")

    Hope it helps
    Toms
    Appreciate clicking the * Add Reputation button on your left side, if you want say thanks to me

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Adding up averages after checking another column

    I don't think that's quite what they're looking for - that will still average all of the rows in column H, but will only show the result if the first value in column E is equal to the sum of A8:A12.

    I'm sure there must be an easier way to do this, but the first formula I came up with (set up to work on the first ten rows of columns E & H) is =SUMPRODUCT(H1:H10,--NOT(ISERROR(MATCH(E1:E10,$A$8:$A$12,0))))/SUMPRODUCT(--(NOT(ISERROR(MATCH(E1:E10,$A$8:$A$12,0)))))
    Last edited by Andrew-R; 09-20-2011 at 05:51 AM.

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

    Re: Adding up averages after checking another column

    Hello Andrew,

    That works for me but it's probably better to use ISNUMBER rather than NOT(ISERROR.....if you don't mind using an "array formula" this is also an option

    =AVERAGE(IF(COUNTIF(A8:A12,E1:E10),H1:H10))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Adding up averages after checking another column

    I don't mind using an array formula, but then it's not my problem

    Personally I'm pretty new to array formula, so I wasn't entirely sure how they'd work when you had one range that was static (A8:A12) and another that was being looped through (E1:E10)

    I suppose that at the very least I should have used ISNA rather than ISERROR in my formula.

+ 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