PC Review


Reply
Thread Tools Rate Thread

Calculating Standard Deviation while ignoring Zeros

 
 
kendrickmr@gmail.com
Guest
Posts: n/a
 
      21st Jan 2007
I am working with a large data set and I am interested in calculating
standard deviation of over 100 samples, but I want to ignore any zero
values and only utilize the non-zero values in the calculation. Does
anyone know an easy way to do this. Thanks for the help.
Mike

 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      21st Jan 2007
Try this array formula:

=STDEV(IF(range<>0,range))

Type the formula, put the address of the range where it says range, and hold
CTRL+SHIFT while pressing Enter. Excel will surround the formula with {curly
braces} if the formula is entered correctly.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am working with a large data set and I am interested in calculating
> standard deviation of over 100 samples, but I want to ignore any zero
> values and only utilize the non-zero values in the calculation. Does
> anyone know an easy way to do this. Thanks for the help.
> Mike
>



 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      21st Jan 2007
=stdev(if(A1:A100=0,false,A1:A100))
Entered with Ctrl+Shift+Enter rather than just enter since this is an array
formula.

--
Regards,
Tom Ogilvy

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am working with a large data set and I am interested in calculating
> standard deviation of over 100 samples, but I want to ignore any zero
> values and only utilize the non-zero values in the calculation. Does
> anyone know an easy way to do this. Thanks for the help.
> Mike
>



 
Reply With Quote
 
merjet
Guest
Posts: n/a
 
      21st Jan 2007
This user-defined function should work.

Function StDevEx0(X As Range) As Double
Dim dArray() As Double

ReDim dArray(0)
For Each c In X
If c <> 0 Then
If dArray(0) = 0 Then
dArray(0) = c
Else
ReDim Preserve dArray(UBound(dArray) + 1)
dArray(UBound(dArray)) = c
End If
End If
Next c
StDevEx0 = Application.WorksheetFunction.StDev(dArray)
End Function


Hth,
Merjet

 
Reply With Quote
 
kendrickmr@gmail.com
Guest
Posts: n/a
 
      22nd Jan 2007
Thanks for the help Jon, that worked great.



Jon Peltier wrote:
> Try this array formula:
>
> =STDEV(IF(range<>0,range))
>
> Type the formula, put the address of the range where it says range, and hold
> CTRL+SHIFT while pressing Enter. Excel will surround the formula with {curly
> braces} if the formula is entered correctly.
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> http://PeltierTech.com
> _______
>
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I am working with a large data set and I am interested in calculating
> > standard deviation of over 100 samples, but I want to ignore any zero
> > values and only utilize the non-zero values in the calculation. Does
> > anyone know an easy way to do this. Thanks for the help.
> > Mike
> >


 
Reply With Quote
 
kendrickmr@gmail.com
Guest
Posts: n/a
 
      22nd Jan 2007
Thanks for your help everyone.


Tom Ogilvy wrote:
> =stdev(if(A1:A100=0,false,A1:A100))
> Entered with Ctrl+Shift+Enter rather than just enter since this is an array
> formula.
>
> --
> Regards,
> Tom Ogilvy
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I am working with a large data set and I am interested in calculating
> > standard deviation of over 100 samples, but I want to ignore any zero
> > values and only utilize the non-zero values in the calculation. Does
> > anyone know an easy way to do this. Thanks for the help.
> > Mike
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Calculating Standard Deviation Mike Painter Microsoft Access Form Coding 0 17th Jun 2009 06:42 AM
Re: Calculating Standard Deviation Tom van Stiphout Microsoft Access Form Coding 0 17th Jun 2009 06:28 AM
Calculating Conditional Standard Deviation? =?Utf-8?B?SGFyaW1hdQ==?= Microsoft Excel Worksheet Functions 5 27th Jun 2007 01:40 PM
Calculating Standard Deviation? Scott Microsoft VB .NET 3 3rd Apr 2006 07:37 PM
calculating standard deviation Bob Weiner Microsoft Excel Discussion 1 4th Feb 2004 06:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:55 AM.