+ Reply to Thread
Results 1 to 14 of 14

Help with excluding a value from an average

  1. #1
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    Help with excluding a value from an average

    Hi all,

    I need help making a formula that finds the average from a range, but finds and excludes any "0"s specifically from that range and thus average. For example:

    1000
    900
    0
    800
    900

    I want the average to be 900 (3600/4).

    1000
    900
    800
    800
    900

    I want the average to be 880 (44000/5).

    Currently my formula is, for example, =IF(cell="","",AVERAGE(RANGE)) and doesn't include the "0" exclusion. Thank you so much!

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Help with excluding a value from an average

    Which version of Excel do you have? 365, 2016 or some other version?

    Try... AVERAGEIFS(Range,Range,"<>0")
    https://support.office.com/en-us/art...8-f7c5c3001690

    If that function isn't available...
    =SUM(Range)/COUNTIF(RANGE,"<>0")
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    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,756

    Re: Help with excluding a value from an average

    Do you have the AVERAGEIF function?

    If so, this:

    =AVERAGEIF(range,">"&0,range)
    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.

  4. #4
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    Re: Help with excluding a value from an average

    Thanks for your help. Your solution worked. But I'll actually add a bit more complexity to my problem now. I actually need the 0 omitted for a CV (in other words standard deviation, STDEV). Does that make sense?

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Help with excluding a value from an average

    Try...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Confirmed as array (CTRL + SHIFT + ENTER)

  6. #6
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    Re: Help with excluding a value from an average

    That didn't work. I tried:
    =IF(cell="","",STDEV(IF(range<>0,'SMedix - Whole Blood'!BJ62:BJ67)/AVERAGEIF(range,">"&0,range))) and got a #VALUE

    This worked for average
    =IF(cell="","",AVERAGEIF(range,">"&0,range))
    Last edited by AliGW; 07-18-2019 at 01:50 AM. Reason: Please don't quote unnecessarily!

  7. #7
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Help with excluding a value from an average

    Can you upload sample workbook(s) showing your issues?

    =STDEV.P(IF(Range<>0,Range)) (or STDEV.S()) does work.

    See below example using STDEV.S
    0.JPG

    See attached.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    Re: Help with excluding a value from an average

    Now I'm thoroughly confused. Entering in your exact formula doesn't change the STDEV between excluding 0 and not.1111.jpg

  9. #9
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Help with excluding a value from an average

    You did not confirm it as array.

    I.E. When you confirm the formula, you can't just hit enter. You need to hit CTRL + SHIFT + ENTER.

  10. #10
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    Re: Help with excluding a value from an average

    I see, thank you for the clarification. Is there a simpler way to do this? I'm generating a calculation sheet for operators and they need to be able to get the value automatically. I can't tell them to hit CTRL SHIFT ENTER.
    Last edited by AliGW; 07-18-2019 at 01:51 AM. Reason: Please don't quote unnecessarily!

  11. #11
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Help with excluding a value from an average

    Hmm? Once the formula is confirmed. It will automatically update when range values change and there is no need to confirm again with CTRL + SHIFT + ENTER.

    If you need to make the range dynamic, just used dynamic named range.

    If operators need to enter the formula or alter it in any way. I'd recommend that they learn it.

    There may be alternatives to array formula, but formula construct will be much more complex and will likely cause more issue if they need to edit it.

    Edit: Unfortunately I can't test it as with recent update to Office 365, you no longer have to use CTRL + SHIFT + ENTER for array formulas. Which made it bit hard to check for backward compatibility.
    Last edited by CK76; 07-17-2019 at 03:47 PM.

  12. #12
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    Re: Help with excluding a value from an average

    Thank you so much. I wasn't aware that the CTRL SHIFT ENTER essentially saves and doesn't have to be clicked each time you change the range values. I dont think I'll ever understand the depths of Excel.
    Last edited by AliGW; 07-18-2019 at 01:51 AM. Reason: Please don't quote unnecessarily!

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Help with excluding a value from an average

    Piggybacking on CK76's file suppose you use a helper column (column C for example) which can be hidden (or placed on another sheet)
    Will not require Ctrl + Shift + Enter


    B
    C
    D
    E
    F
    G
    H
    1
    2
    100
    100
    In C2: =IF(B2,B2)
    3
    0
    FALSE
    4
    101
    101
    STDEV.S
    Exclude 0
    Average
    Exclude 0
    5
    99
    99
    50.00667
    1
    75
    100
    6
    In F5: =STDEV.S(C2:C5)
    Dave

  14. #14
    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,756

    Re: Help with excluding a value from an average

    Administrative Note:

    Bigscientist - please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.

+ 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. Replies: 2
    Last Post: 04-17-2018, 09:45 PM
  2. average excluding zero's
    By ldurham in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-15-2016, 01:24 PM
  3. [SOLVED] Get average excluding the last value.
    By ihrktho in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-09-2014, 10:54 AM
  4. Average() excluding zero's
    By HPIMICHAEL02 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-10-2013, 02:58 AM
  5. The rank of average ranks excluding empty cells but including their average.
    By Terminal45 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2012, 03:44 AM
  6. Average excluding DIV/0
    By olga6542 in forum Excel General
    Replies: 1
    Last Post: 06-14-2010, 03:24 PM
  7. AVERAGE excluding #N/A
    By RonB in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-02-2005, 05: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