+ Reply to Thread
Results 1 to 8 of 8

How to Average values of Top/bottom 3 of another column

  1. #1
    Registered User
    Join Date
    03-09-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    58

    How to Average values of Top/bottom 3 of another column

    I have this data set. I need to calculate average of top 3 of another column.

    I googled, I couldn't figured out this. And more thing is there are blank cells as well in the data.

    I am attaching a sample excel sheet. Please find the attachment.

    Average values in Column B based on Top 3 values of Column A

    Average values in Column C based on Top 3 values of Column D

    Currently I am using conditional formatting to highlight the cells of top values and manually select adjacent cells to know the average. I would to have a formula for this. Any help would be appreciated.

    Here is the snapshot of the data.

    DlCkLy6.png
    Attached Files Attached Files
    Last edited by TK2013; 07-14-2019 at 12:37 AM. Reason: Updated file

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    47,079

    Re: How to Average values of Top/bottom 3 of another column

    The attached workbook looks nothing like the screenshot ... It has only two columns and no CF.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Registered User
    Join Date
    03-09-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: How to Average values of Top/bottom 3 of another column

    Tried this, but only returning the average of top 1 value.
    =AVERAGEIFS(B2:B11,A2:A11,LARGE(A2:A11,{1,2,3}))

    ^Sorry
    I will upload again
    Attached Files Attached Files
    Last edited by TK2013; 07-08-2019 at 09:13 AM. Reason: Attached a file

  4. #4
    Registered User
    Join Date
    03-09-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: How to Average values of Top/bottom 3 of another column

    Both Average and Averageif function returning just the top value.

    I tried the same with sumif function, it works for the addition part. But to average I had to manually type in number of top values with no blank cells
    =(SUMIF(A2:A11,LARGE(A2:A11,1),B2:B11)+SUMIF(A2:A11,LARGE(A2:A11,2),B2:B11)+SUMIF(A2:A11,LARGE(A2:A11,3),B2:B11))/2 >>> It's 2 because there are only two cells with values.

    For now I will use this until I get a better formula.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2010/2019
    Posts
    11,881

    Re: How to Average values of Top/bottom 3 of another column

    Perhaps the following formula will be helpful:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    4,727

    Re: How to Average values of Top/bottom 3 of another column

    Or try:

    =AVERAGE(IF((A2:A11=LARGE(A2:A11,{1,2,3}))*(B2:B11<>""),B2:B11))

    Enter with Ctrl+Shift+Enter.

  7. #7
    Registered User
    Join Date
    03-09-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    58

    Thumbs up Re: How to Average values of Top/bottom 3 of another column

    Quote Originally Posted by JeteMc View Post
    Perhaps the following formula will be helpful:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Quote Originally Posted by Phuocam View Post
    Or try:

    =AVERAGE(IF((A2:A11=LARGE(A2:A11,{1,2,3}))*(B2:B11<>""),B2:B11))

    Enter with Ctrl+Shift+Enter.
    Thank you guys. Both works fine.

    In the first formula,
    Instead of blanks in the column B, if I put hyphen (-) it returns #VALUE!
    Other than that both the formula works fine.

    Thank you so much.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2010/2019
    Posts
    11,881

    Re: How to Average values of Top/bottom 3 of another column

    Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Average the bottom 95$ of values
    By shauncie in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-02-2016, 03:27 PM
  2. Calculating the average(s) of top, middle and bottom quarter values
    By AndrejLav in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-19-2015, 10:30 PM
  3. drop top and bottom values before computing average
    By jimboryan in forum Excel General
    Replies: 2
    Last Post: 07-15-2014, 04:04 PM
  4. Capturing values at the bottom of a column
    By mmckenna in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-13-2011, 09:26 AM
  5. Input 6 values, transpose to bottom of a column
    By bluerog in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2010, 05:34 PM
  6. Input 6 values, transpose to bottom of a column
    By bluerog in forum Excel General
    Replies: 0
    Last Post: 10-28-2010, 11:13 AM
  7. Column Values Re-Order Bottom to Top
    By Jerry Pio in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-10-2006, 10:16 AM

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