XL: Order Data Is Entered Changes Results of STDEV() FunctionLast reviewed: September 2, 1997Article ID: Q111727 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, the results you get when you use the STDEV() function may vary depending on the order in which you enter the values. This behavior is incorrect: the results of this function should not depend on the order in which you enter the values.
CAUSEThe process used to calculate the standard deviation involves the subtraction of two values that may be very similar to each other. The numbers may be calculated incorrectly because the two numbers may be rounded incorrectly. This incorrect rounding occurs because of the way a computer stores and manipulates numbers.
WORKAROUNDTo work around this problem, round the data when you calculate the standard deviation. The following is a sample Visual Basic function that you can use to round the data as you calculate the standard deviation. Microsoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support engineers can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.
Visual Basic Example
MORE INFORMATIONFor more information about Data Types, choose the Search button in Visual Basic Help, and type the following:
data types |
Additional query words: 5.00 7.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |