+ Reply to Thread
Results 1 to 9 of 9

How to calc stdev but to exclude 0's. Prefer no array cntrl + Shift + enter calcs

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    How to calc stdev but to exclude 0's. Prefer no array cntrl + Shift + enter calcs

    I have a list of numbers and i want to calculate avg and stdev but i do not want "zeros" or "blanks" to enter into the calculations. I have a formula for avg but i need one for stdev.
    Last edited by welchs101; 12-12-2008 at 07:20 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    If you have a formula that works for AVERAGE, just change AVERAGE to STDEV.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    cant just replace STDEV and AVG.....wont work

    formula for avg:
    SUM(A1:A5)/COUNTIF(A1:A5,">0")


    Cant just replace avg with stdev

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    =stdev(if(a1:a5>0, a1:a5))

    That is an array formula, though.

  5. #5
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    hi

    Yeah, its hard to find a formula with out using the array calc.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You could do it with a helper column: =if(a1>0, (a1-avg)^2, ""), where avg is the value you computed with your other formula.

    Then St Dev =sqrt(sum(B1:B5) / (count(b1:b5) - 1) )

    Why the aversion to array formulas?
    Last edited by shg; 12-12-2008 at 06:59 PM.

  7. #7
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662
    I have used array formulas in the past and they mess me up sometimes. I also remember reading somewhere that there are certain rules you must follow so you dont get an error when using array formulas......do you know what they are?

  8. #8
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662
    for got to say thanks for replying.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You're welcome.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

    Edit: I'm not aware of any bugs with array formulas. They should be used thoughtfully, because they can be compute-intensive.

    Then only rule I know of (aside from ensuring that arrays match) is that they need to be confirmed with Ctrl+Shift+Enter.

    If you don't use them at all, you're missing one of Excel's most powerful features.
    Last edited by shg; 12-12-2008 at 07:15 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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