+ Reply to Thread
Results 1 to 4 of 4

How to Get the Average of a Range Based on 2 Conditions

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    stockton, ca
    MS-Off Ver
    Excel 2003
    Posts
    29

    How to Get the Average of a Range Based on 2 Conditions

    I want to the get the average of all entries in N:N. The values included in the average must meet either one of these criteria

    1. equal "4" in C:C
    2. equal "5" in C:C

    Said plainly - I would like the average of all values in N:N that are either a "4" or a "5" in C:C.

    Can't get the syntax right. Thanks.

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

    Re: How to Get the Average of a Range Based on 2 Conditions

    Try this "array formula"

    =AVERAGE(IF(C2:C100={4,5},N2:N100))

    confirmed with CTRL+SHIFT+ENTER

    or you can use a non-array version like this

    =SUM(SUMIF(C:C,{4,5},N:N))/SUM(COUNTIF(C:C,{4,5}))
    Audere est facere

  3. #3
    Registered User
    Join Date
    10-22-2012
    Location
    stockton, ca
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: How to Get the Average of a Range Based on 2 Conditions

    The array formula worked great, thanks. I couldn't figure out how to get the array syntax working for my problem. Much appreciated.

  4. #4
    Registered User
    Join Date
    03-18-2013
    Location
    Appleton, Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How to Get the Average of a Range Based on 2 Conditions

    Great work guys, can either of you make available a spreadsheet I can download and try out? I think this might solve my question/problem that I have been searching for answers for on a lot of threads. I am a newbie and any extra help is greatly appreciated. Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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