+ Reply to Thread
Results 1 to 7 of 7

Average of numbers within a range meeting certain criteria

  1. #1
    opal23k
    Guest

    Average of numbers within a range meeting certain criteria

    I have a column of test scores - N9:N154.

    Scores can be grouped into low (<=79), average (80<=x>=120), and high
    (>=121).

    I want to have one formula for each group that will find the average score
    for that group.

    The logic is something like:
    Low group: find the average of all the scores that are less than or equal to
    79 within N9:N154.
    Middle group: find the average of all the scores between 80 and 120 within
    N9:N154.
    High group: find the average of all the scores higher than or equal to 121
    within N9:N154.



  2. #2
    Domenic
    Guest

    Re: Average of numbers within a range meeting certain criteria

    Try the following formula that need to be confirmed with
    CONTROL+SHIFT+ENTER, not just ENTER...

    =AVERAGE(IF(N9:N154<=79,N9:N154))

    =AVERAGE(IF((N9:N154>=80)*(N9:N154<=120),N9:N154))

    =AVERAGE(IF(N9:N154>=121,N9:N154))

    Hope this helps!

    In article <[email protected]>,
    "opal23k" <[email protected]> wrote:

    > I have a column of test scores - N9:N154.
    >
    > Scores can be grouped into low (<=79), average (80<=x>=120), and high
    > (>=121).
    >
    > I want to have one formula for each group that will find the average score
    > for that group.
    >
    > The logic is something like:
    > Low group: find the average of all the scores that are less than or equal to
    > 79 within N9:N154.
    > Middle group: find the average of all the scores between 80 and 120 within
    > N9:N154.
    > High group: find the average of all the scores higher than or equal to 121
    > within N9:N154.


  3. #3
    David Billigmeier
    Guest

    RE: Average of numbers within a range meeting certain criteria

    Opal - these formulas will give you what you're after, confirm with
    ctrl+shift+enter

    Low Average:
    =AVERAGE(IF(N9:N154<=79,N9:N154,""))

    Middle Average:
    =AVERAGE(IF(AND(N9:N154>=80,N9:N154<=120),N9:N154,""))

    High Average:
    =AVERAGE(IF(N9:N154>=121,N9:N154,""))

    Hope that helps,

  4. #4
    opal23k
    Guest

    RE: Average of numbers within a range meeting certain criteria

    Thank you David!

    "David Billigmeier" wrote:

    > Opal - these formulas will give you what you're after, confirm with
    > ctrl+shift+enter
    >
    > Low Average:
    > =AVERAGE(IF(N9:N154<=79,N9:N154,""))
    >
    > Middle Average:
    > =AVERAGE(IF(AND(N9:N154>=80,N9:N154<=120),N9:N154,""))
    >
    > High Average:
    > =AVERAGE(IF(N9:N154>=121,N9:N154,""))
    >
    > Hope that helps,


  5. #5
    opal23k
    Guest

    Re: Average of numbers within a range meeting certain criteria

    Thank you Domenic!

    "Domenic" wrote:

    > Try the following formula that need to be confirmed with
    > CONTROL+SHIFT+ENTER, not just ENTER...
    >
    > =AVERAGE(IF(N9:N154<=79,N9:N154))
    >
    > =AVERAGE(IF((N9:N154>=80)*(N9:N154<=120),N9:N154))
    >
    > =AVERAGE(IF(N9:N154>=121,N9:N154))
    >
    > Hope this helps!
    >
    > In article <[email protected]>,
    > "opal23k" <[email protected]> wrote:
    >
    > > I have a column of test scores - N9:N154.
    > >
    > > Scores can be grouped into low (<=79), average (80<=x>=120), and high
    > > (>=121).
    > >
    > > I want to have one formula for each group that will find the average score
    > > for that group.
    > >
    > > The logic is something like:
    > > Low group: find the average of all the scores that are less than or equal to
    > > 79 within N9:N154.
    > > Middle group: find the average of all the scores between 80 and 120 within
    > > N9:N154.
    > > High group: find the average of all the scores higher than or equal to 121
    > > within N9:N154.

    >


  6. #6
    Dodo
    Guest

    Re: Average of numbers within a range meeting certain criteria

    "=?Utf-8?B?b3BhbDIzaw==?=" <[email protected]> wrote in
    news:[email protected]:

    > I have a column of test scores - N9:N154.
    >
    > Scores can be grouped into low (<=79), average (80<=x>=120), and high
    > (>=121).
    >
    > I want to have one formula for each group that will find the average
    > score for that group.
    >


    I do not know where you have room in the sheet; suppose columns to the
    right of N are free.

    When N8 contains the header: Score

    Put this text in P1 - Q1 - R1 - S1: Score

    Put this in P2: <80
    Put this in Q2: >=80
    Put this in R2: <121
    Put this in S2: >=121

    In P10 the formula for Low: =DAVERAGE(N8:N154,"score",P1:P2)
    In P12 the formula for Med: =DAVERAGE(N8:N154,"score",Q1:R2)
    In P14 the formula for Hi: =DAVERAGE(N8:N154,"score",S1:S2)

    This way you see the criteria for the average groups and can easily change
    them.

    By making a criteria range across 2 columns and the criteria in the same
    row, you create an AND operator.
    Would you put the criteria in the same column in 2 rows, you'll get an OR
    operator.


    --

    It is I, DeauDeau
    (Free after monsieur Leclerc in 'Allo, 'allo)

  7. #7
    Registered User
    Join Date
    12-13-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    1

    Thumbs up Re: Average of numbers within a range meeting certain criteria

    Thanks for the post, Domenic.

    Have been searching on the web for ages trying to find the answer to that one.

    In addition to the requested formula I also wanted to ignore the blank cells as my range is within both positive and negative numbers and included in that range would be zero which Excel treats the same as a blank. This makes the average answer less than it should be.

    So, assuming a range of plus and minus 100, and to ensure the blank cells don't drag down the overall specified range "average" the formula would be:

    Middle Average:
    =AVERAGE(IF((N9:N154>=-100)*(N9:N154<=100)*(N9:N154<>0),N9:N154))

    I guess the additional *(N9:N154<>0) gets added to the Low and High Averages to achieve the same effect, assuming that High Averages start below zero, and Low Averages above, otherwise it's not needed.

    Oh, and don't forget to "Command/Shift/Enter" at the end for the formula to kick in. Otherwise you get a nasty #VALUE! message.

    Great site. Often find the answer I'm after.
    Last edited by steve222; 12-15-2010 at 08:11 AM.

+ 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