+ Reply to Thread
Results 1 to 8 of 8

Ignore Highest and Lowest Values

  1. #1
    Registered User
    Join Date
    05-18-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    1

    Ignore Highest and Lowest Values

    Hi folks,

    Anyone know how to go about creating a formula that can be used to ignore (ie not remove bu simply set to zero) the highest and lowest values from an array of values..?

    Value 1 - 9 (ignore)
    Value 2 - 3
    Value 3 - 4
    Value 4 - 5
    Value 5 - 7
    Value 6 - 2 (ignore)

    Using the above data I would like to calculate an average but I'd like to strip-out the highest and lowest value from the calculation....

    Another consideration is calculation of a weighted average value where the highest and lowest value are given a much lower weighting that the other values.

    Value 1 - 9 (weight = 0.5)
    Value 2 - 3 (weight = 1.0)
    Value 3 - 4 (weight = 1.0)
    Value 4 - 5 (weight = 1.0)
    Value 5 - 7 (weight = 1.0)
    Value 6 - 2 (weight = 0.5)

    Again - I'd like to determine a weighted average but values 1 and 6 are given differing weights...

    Any thought..?

    Regards,

    Dan

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

    Re: Ignore Highest and Lowest Values

    Try:

    =AVERAGE(IF(A1:A6<>MAX(A1:A6),IF(A1:A6<>MIN(A1:A6),A1:A6)))

    confirmed with CTRL+SHIFT+ENTER not just ENTER.

    NOTE:
    This will remove all occurances of the max and/or min value from the list....
    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
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Ignore Highest and Lowest Values

    If you meant to average the middle cells excluding the topmost and the bottommost.. then try:

    =AVERAGE(INDEX(A1:A6,2):INDEX(A1:A6,COUNT(A1:A6)-1))

  4. #4
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Ignore Highest and Lowest Values

    Formula 1, could be with:
    =(SUM(A1:A100)-MIN(A1:A100)-MAX(A1:A100))/(COUNTA(A1:A100)-2)

    What do you consider weighted average. Value x weight factor? If so, do that calculation on another column, and then use that column in the SUM Range (that is, instead of SUM(A1:A100), it can be SUM(C1:C100), this is the column that has the results to your multiplication)

    EDIT: Or an array as given by NBVC. With my example you can continue adding values to column A without changing the formula thou
    Last edited by ron2k_1; 05-18-2011 at 02:34 PM.
    Ron
    Knowledge is knowing that a tomato and pepper are fruits. Wisdom is knowing whether to put these in a fruit salad

    Kindly

    [1] Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks
    [2] Mark your post [SOLVED] if it has been answered satisfactorily by editing your original post in advanced mode.
    [3] Thank (using the little scale) those that provided useful help; its nice and its very well appreciated

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

    Re: Ignore Highest and Lowest Values

    There is a specific function in Excel to average without "outliers" - TRIMMEAN

    You can set it to ignore differing numbers of max/min values, this version will ignore just the largest and smallest

    =TRIMMEAN(range,2/COUNT(range))

    where range is where your values reside
    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: Ignore Highest and Lowest Values

    Forgot about that one

  7. #7
    Registered User
    Join Date
    05-25-2012
    Location
    Plantation, florida
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Ignore Highest and Lowest Values

    Sounds like just what I was looking for. Will give it a try, thanks everyone.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Ignore Highest and Lowest Values

    Nice 1 NBVC, that is a really handy function to remember
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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