+ Reply to Thread
Results 1 to 6 of 6

Array formula which can average and sum two different criteria

  1. #1
    Registered User
    Join Date
    10-14-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    25

    Array formula which can average and sum two different criteria

    Hi all

    I have been working on an array formula but can't seem to crack it - I need it to do what the attached Pivot table does (that should make it easier) I need a formula which can accomplish the same thing as the pivot table as I need to edit the formula to be able to delpoy it elsewhere.

    As you can see from the pivot table it needs to get me an average of people who went to a specific university (from column A, got to a technical interview and the respective scores for that university)

    As a result of that calculation I will know what the average score of people who got a technical interview is depending on their university.

    If anyone knows how to finish off my formula in the worksheet "interview analysis" column L I would be very grateful.

    I was almost there but it's missing a few people and I don't know how to average it off.

    I have removed the other sheets which had peoples personal information in hence the large number of # values.
    Attached Files Attached Files

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

    Re: Array formula which can average and sum two different criteria

    Try:

    Please Login or Register  to view this content.
    copied down
    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-14-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Array formula which can average and sum two different criteria

    You're a hero I don't know how the hell you do that.

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

    Re: Array formula which can average and sum two different criteria

    Sumproduct() can be used to SUM or COUNT based on conditions... similar to SUMIF and COUNTIF, but you can use multiple conditions with SUMPRODUCT(). In Excel 2007 and later they added SUMIFS and COUNTIFS which allow multiple conditions, and even AVERAGEIF and AVERAGEIFS, which would make this an easier task....

    Read here on Sumproduct() to see how it can be used for these tasks.

    So I have a SUMPRODUCT() to sum divided by a SUMPRODUCT() to count.... the initial LOOKUP(9.99999e+307,CHOOSE({1,2},0,Your_formula)) is an error trap trick.. it returns a 0 if the averaging returns a #Div/0! error due to denominator being 0 (i.e no matches).

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

    Re: Array formula which can average and sum two different criteria

    To get zero instead of #DIV/0 error you could also use this type of setup

    =SUMPRODUCT(test1,test2,sumrange)/MAX(1,SUMPRODUCT(test1,test2))
    Audere est facere

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

    Re: Array formula which can average and sum two different criteria

    a much better way...

+ 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