+ Reply to Thread
Results 1 to 18 of 18

How to remove number(s) from average formula

Hybrid View

  1. #1
    Registered User
    Join Date
    10-27-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    12

    How to remove number(s) from average formula

    I have a formula that averages up to 6 numbers. Sometimes there is less than 6 numbers in the range for me to average.

    Often there is an anomoly in the numbers with one number not consistent with the others.

    The formula I am currently using is:

    =IF(ISERROR(AVERAGEIF(AI4:AI9,"<>0")),"0.00",AVERAGEIF(AI4:AI9,"<>0"))

    The numbers to be averaged might be like this

    0.05
    0.08
    -0.02
    -0.01
    0.02
    0.70

    = average 0.14

    The 0.70 is the anamoly - is there a way to change my formula to exclude any number that is more that .3 different from the lowest number in the range? That would deliver an average of 0.02

    Thanks

  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
    53,048

    Re: How to remove number(s) from average formula

    Try taking a look at averageifS() for this - it allows for more than just 1 argument.

    Also, remove the "" from around the 0.00...this returns a text string, not a value.

    Another way to write your formula...
    =IfERROR(AVERAGEIF(AI4:AI9,"<>0"),0)
    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
    10-27-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    12

    Re: How to remove number(s) from average formula

    Thank you for the simplification of my original formula. I had tried averageifs with my original formula but couldn't seem to get it right. I will have to keep playing with it and see what i can do.

  4. #4
    Registered User
    Join Date
    10-27-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    12

    Re: How to remove number(s) from average formula

    Still can't seem to get the syntax right for the averageifs statement to exclude numbers >.3 than min in range. Could anyone please help with how I structure the range and criteria?

    Thanks again

  5. #5
    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
    53,048

    Re: How to remove number(s) from average formula

    So >.3 from the next lowest value?

    What if there had been 2 0.7's?

  6. #6
    Registered User
    Join Date
    10-27-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    12

    Re: How to remove number(s) from average formula

    No, I really want to exclude any numbers that are more than .3 larger than the smallest number.

    So, if the smallest number was 0.00, exclude anything .3 and larger and then average what is left.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: How to remove number(s) from average formula

    Try this:

    =AVERAGE(FILTER(A1:A6,A1:A6<=MIN(A1:A6)+0.3))

    where A1 to A6 conitains:

    0.05
    0.08
    -0.02
    -0.01
    0.02
    0.70
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: How to remove number(s) from average formula

    I see that you have never marked previous threads as solved.

    If this 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.

  9. #9
    Registered User
    Join Date
    10-27-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    12

    Re: How to remove number(s) from average formula

    Thank you - this formula seems to work if ther are 6 numbers in the range. Sometimes there are not 6, but less, so part of the range might contain zero cells. Sometimes the range contains a N/A cell. The normal average ignores these but this formula seems to include them in the average.



    0.07
    0.38
    0.34
    (with 3 blank cells)

    returned 0.02 with the above formula (should have been 0.07). I think it counted the cell with 0.07 and the 3 blank cells and divided by 4 cells. If all 6 cells in range are numbers, then I think this will work, will have to test it but is there a way to ignore blank cells and N/A cells?

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: How to remove number(s) from average formula

    Gary - please provide REALISTIC data from the get go in future.

    Attach a workbook that incliudes all eventualities and then I'll look again.

    seems to work if ther are 6 numbers in the range
    It works for what you asked for!!!

  11. #11
    Registered User
    Join Date
    10-27-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    12

    Re: How to remove number(s) from average formula

    Thanks, I will try and put up an example.

    You may not have seen my original post:

    I have a formula that averages up to 6 numbers. Sometimes there is less than 6 numbers in the range for me to average.
    That's a big part of where I was having the problem.

    Thanks so much for your efforts.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: How to remove number(s) from average formula

    Of course I saw (and read) your original post!!! How could I have offered a suggestion otherwise?

    Sometimes there is less than 6 numbers in the range for me to average.
    That (to me) meant that the range might be smaller. It did not explicitly state that there could be blanks or #N/A values, nor does your thread title hint at this.

    WHEN you have provided a fully realistic data sample, I will look again. I will wait until I have this.

  13. #13
    Registered User
    Join Date
    10-27-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    12

    Re: How to remove number(s) from average formula

    Sorry, I obviously didn't explain it well enough. I thought by posting the formula that I currently use - showing it averaging 6 cells and stating that there are sometimes less than 6 numbers would explain and indicate that the other cells when less than 6 numbers would be blank. I wasn't aware they could be anything else.

    I can't find a way to close the thread without marking it as solved - I don't use this forum very often so not very familiar with the tools.

    Thanks again for your efforts and apologies for not explaining it well to commence.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: How to remove number(s) from average formula

    There is NO NEED to close the thread. All you need to do is post a sample workbook with some realistic data and then we can take it from there.

    To be clear: sharing a formula that you know does not work doesn't really help.

    Please attach a small sample workbook as requested and then I'll have another look. Why is providing a sample workbook a problem?

    In the sample workbook, please show us what this looks like:

    Sometimes there are not 6, but less, so part of the range might contain zero cells. Sometimes the range contains a N/A cell.
    Last edited by AliGW; 07-26-2022 at 02:49 AM.

  15. #15
    Registered User
    Join Date
    10-27-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    12

    Re: How to remove number(s) from average formula

    The workbook is not mine - I will need to get permission to share any form of data or extract data into a mockup sheet which I will look at doing when I get finished with some deadline stuff on my desk.

    The formula I posted does work - I have been using it for years. What I wanted to do was to modify the formula to allow me to differently analyse the data and rule out any anomolies without having to manually remove cells.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: How to remove number(s) from average formula

    I just want a sample workbook that includes data including an outlier, blanks and #N/A - I don't need to see the real data. You have already shared data - that's what I want, but in a sample workbook.

    I'm really trying to help here ...

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: How to remove number(s) from average formula

    OK - one final guess, then:

    =LET(f,FILTER(A1:A6,IFERROR(A1:A6<>"",0)),m,MIN(f)+0.3,n,FILTER(f,f<=m),AVERAGE(n))
    Attached Files Attached Files

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: How to remove number(s) from average formula

    No response and now gone ...

    Hopefully you'll see this later. If it works, please mark the thread as solved, etc., as explained earlier. Thanks.

+ 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. Excel formula to remove a certain number of characters IF...
    By Justin.yiriley in forum Excel General
    Replies: 3
    Last Post: 05-20-2022, 06:02 PM
  2. Replies: 1
    Last Post: 07-29-2020, 06:21 AM
  3. Looking to remove quote (inches) from number to use in formula
    By slade8200 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-21-2019, 11:32 AM
  4. [SOLVED] remove number from cell with a formula
    By MetteGaga in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-17-2016, 07:52 AM
  5. Remove Lowest Number From Running Average Equation
    By AR_Tiger in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-18-2015, 03:32 PM
  6. Formula to remove text and then average a range
    By Chaba in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-26-2015, 12:05 PM
  7. Formula to Remove 2nd Number Group From String
    By chbrandt in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-03-2011, 03:37 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