+ Reply to Thread
Results 1 to 6 of 6

Eliminating some data from averageif calculation

  1. #1
    Registered User
    Join Date
    08-13-2014
    Location
    Australia
    MS-Off Ver
    365
    Posts
    25

    Eliminating some data from averageif calculation

    Hello, I currently have a sheet where a formula delivers the largest 3 numbers sorted in order from a maximum 6 rows of data.

    I then run another formula that averages that returned data - eg the average of the 3 highest values.

    =AVERAGEIF(AJ4:AJ6,"<>0")

    Sometimes I get some anomalies where the original 3 returned numbers will not be as close to each other in values (as they should be).

    What I would like to be able to do it to eliminate any number that is, say .50 less than the largest number, and then average the remaining.

    For example, if the original returned numbers were 20.69, 20.49, 20.09 - I would like to eliminate the 20.09 and then calculate the average of the other 2 numbers.

    Is there something that I can add to my existing formula - =AVERAGEIF(AJ4:AJ6,"<>0") - that will eliminate anything more than .5 less than the highest number in the range and then calculate the average?

    Many thanks

    Gary
    Last edited by blogger153; 05-30-2022 at 12:55 AM.

  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: Eliminating some data from averageif calculation

    If you need more arguments, take a look at averageifS() instead
    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
    08-13-2014
    Location
    Australia
    MS-Off Ver
    365
    Posts
    25

    Re: Eliminating some data from averageif calculation

    Thanks.

    In my current formula, AJ4 is the largest number returned.

    I have looked at AVERAGEIFS but can't figure out how to express the criteria to eliminate anything more than .5 smaller than AJ4.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,828

    Re: Eliminating some data from averageif calculation

    Try this:

    =IF(MAX($AJ$4:$AJ$6)-MIN($AJ$4:$AJ$6)>0.5,AVERAGEIF($AJ$4:$AJ$6,">"&MIN($AJ$4:$AJ$6)),AVERAGEIF($AJ$4:$AJ$6,"<>0"))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    08-13-2014
    Location
    Australia
    MS-Off Ver
    365
    Posts
    25

    Re: Eliminating some data from averageif calculation

    Thank you very much - that seems to work. I will run some calcs to fully test.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,828

    Re: Eliminating some data from averageif calculation

    Glad to have helped.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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. Working With Worksheet Data Slow After Eliminating 1000's Of Rows Of Data
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-09-2019, 08:17 PM
  2. Replies: 2
    Last Post: 04-30-2017, 08:28 PM
  3. Replies: 0
    Last Post: 09-09-2013, 10:44 AM
  4. Eliminating cells which contain no data
    By lukebarnett in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-10-2012, 09:49 AM
  5. [SOLVED] Eliminating data in set that is not in other set
    By redfuse in forum Excel General
    Replies: 4
    Last Post: 06-18-2012, 08:42 AM
  6. Eliminating Excess Data
    By Jakila2 in forum Excel General
    Replies: 2
    Last Post: 03-04-2011, 07:23 PM
  7. Eliminating duplicated data
    By tpa754 in forum Excel General
    Replies: 4
    Last Post: 12-18-2006, 04:06 PM

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