+ Reply to Thread
Results 1 to 5 of 5

Omitting the top or bottom x values

  1. #1
    Registered User
    Join Date
    01-08-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2013
    Posts
    79

    Omitting the top or bottom x values

    Hello. I am looking to change the formulas below omit more than just the highest or lowest value.

    I use these functions to find the average of the positive and negative numbers, while omitting the top or bottom value.
    (Positive) =(SUMIF(L48:L67,">0")-MAX(L48:L67))/(COUNTIF(L48:L67,">0")-1)
    (Negative) =(SUMIF(L48:L67,"<0")-MIN(L48:L67))/(COUNTIF(L48:L67,"<0")-1)

    I am looking on how I can have it omit the top/bottom 2 values? In this case there are 20 different values in the array, both positive and negative mix.

    thanks!!!!
    Brennen

  2. #2
    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,933

    Re: Omitting the top or bottom x values

    Try this...
    =SUMIFS($A$1:$A$10,$A$1:$A$10,">"&SMALL($A$1:$A$10,2),$A$1:$A$10,"<"&LARGE($A$1:$A$10,2))
    A
    1
    1
    2
    2
    3
    3
    4
    4
    5
    5
    6
    6
    7
    7
    8
    8
    9
    9
    10
    10

    gives answer of 33

    Edit: to make this moere flexible, you could put the 2 (bolded) in its own cell, so you can chage from 2 highest 3 highest, 1 highest etc
    Last edited by FDibbins; 04-03-2014 at 07:07 PM.
    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

  3. #3
    Registered User
    Join Date
    01-08-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2013
    Posts
    79

    Re: Omitting the top or bottom x values

    Hello. I appreciate the reply. I think I am missing something. Does this omit the 2 positive or negative? I am looking for separate formulas to do both. I put that in my spreadsheet and it doesn't seem to work.

    I attached an example of my data. On the first green cell below the number set I am looking to average the positive numbers without the top 2. Then the negative numbers without the bottom 2 on the next cell below that.

    Could you help as to how you would put the formula in this sheet?

    Average test.xlsx

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Omitting the top or bottom x values

    is this an average? if so try trimmean() ignore this it is sooo wrong!
    Last edited by martindwilson; 04-03-2014 at 09:52 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    01-08-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2013
    Posts
    79

    Re: Omitting the top or bottom x values

    I got it. I did it this way. To average the positive numbers less the top 2...

    =SUMIF((EB2570:EB2589,">0")-SUM(LARGE(EB2570:EB2589,{1,2})))/(COUNTIF(EB2570:EB2589,">0")-2)

    This sums the numbers greater than 0, subtracts the sum of the largest 2, divides that number by the amount of numbers positive minus 2.

    Then this for the negative.

    =SUMIF((EB2570:EB2589,">0")-SUM(SMALL(EB2570:EB2589,{1,2})))/(COUNTIF(EB2570:EB2589,"<0")-2)


    This make sense to all?


    I need each of the positive and negative averages separatly so TRIMMEAN doesnt work in this case.

+ 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. [SOLVED] Omitting Null Values from a text string
    By Skycap in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-03-2013, 02:32 AM
  2. Bottom Values for any given dept
    By coda1395 in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 07-09-2013, 12:47 PM
  3. [SOLVED] Change values from bottom to top
    By agriz in forum Excel General
    Replies: 5
    Last Post: 07-19-2012, 07:03 AM
  4. [SOLVED] Count Values - Omitting Duplicates
    By bh2 in forum Excel General
    Replies: 2
    Last Post: 05-30-2012, 02:04 PM
  5. Omitting NA values in Histogram, Can it be done?
    By alabatusa in forum Excel General
    Replies: 0
    Last Post: 02-07-2012, 03:38 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