+ Reply to Thread
Results 1 to 6 of 6

AVERAGEIFS with multiple criteria

  1. #1
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    AVERAGEIFS with multiple criteria

    I've read that the AVERAGEIF function can't take OR as criteria, but there has to be some workaround to this.
    I need the formula to tell me the average of value of the cells in the H column, but only if the J cell is either "2-0", or "2-1".
    Note that the sheet is affected by autofilter.
    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: AVERAGEIFS with multiple criteria

    You could use =AVERAGE(IF(J2:J540="2-1",J2:J540="2-0",H2:H540))
    It needs to be entered as an array formula with Ctrl+Shift+Enter rather than just Enter.

  3. #3
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    Re: AVERAGEIFS with multiple criteria

    Thanks for your answer. Now that I look at the thread title, it should have been AVERAGEIF with one of multiple criteria
    Your formula seems to be working but I have one question.
    When I filter by "2-0" and "2-1" in the set column, the average is 1.52, whereas the formula says 1.44

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: AVERAGEIFS with multiple criteria

    I didn't download your file.

    Try this array formula**:

    =AVERAGE(IF(SUBTOTAL(2,OFFSET(H2,ROW(H2:H20)-ROW(H2),0)),IF(ISNUMBER(MATCH(J2:J20,{"2-0","2-1"},0)),H2:H20)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Adjust the ranges to suit.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    Re: AVERAGEIFS with multiple criteria

    This is just what I needed, on the other hand I'm sad because I would have never figured this out on my own.
    Gracias!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: AVERAGEIFS with multiple criteria

    The folks at Microsoft didn't make it easy to perform calculations on filtered data!

    Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. AVERAGEIFS with multiple criteria on one range
    By ctsmith84 in forum Excel General
    Replies: 7
    Last Post: 04-23-2020, 11:31 PM
  2. AVERAGEIFS(), with multiple criteria
    By Jkember in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-21-2014, 06:33 PM
  3. AVERAGEIFS Multiple Criteria
    By qhoney in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-05-2014, 03:58 PM
  4. [SOLVED] Averageifs with multiple criteria
    By jbillyo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2013, 04:13 PM
  5. AverageIfs for multiple criteria in different columns
    By HBEE in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-05-2013, 12:21 PM

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