Excel: Using Time Values that Include Fractions of a SecondLast reviewed: November 30, 1994Article ID: Q92559 |
The information in this article applies to:
SUMMARYIn Microsoft Excel you can include fractions of a second in serial time values; however, if you type a time value that includes a decimal point, Microsoft Excel interprets the value as a text value rather than as a serial time value. For example, if you type "3:25:24", Microsoft Excel interprets this number as a serial time value, but if you type "3:25:24.5", Microsoft Excel interprets this value as text. To convert this text value to a serial time value so you can use it in time calculations, see the formula in the example below (in the more information section of this article).
MORE INFORMATIONIf you are working with time values that include fractions of a second, use the following formula to convert the text you enter to a serial time value that can be used in calculations. In this example, type the time value in cell A1 (including the fraction of a second) and then type the entire formula in cell A2. Excel displays the serial value in cell A2. A1: 3:25:24.5 A2: =TIMEVALUE(LEFT(A1,LEN(A1)-(LEN(A1)-FIND(".",A1)+1)))+VALUE(RIGHT( A1,LEN(A1)-FIND(".",A1)))*(1/24/60/60/(10^(LEN(A1)-FIND(".",A1))))Important: Type the entire formula in cell A2. In the above formula, the TIMEVALUE() function is used to return the value while the FIND() and LEN() functions break the text string at the decimal point:
REFERENCES"Microsoft Excel User's Guide 1," version 4.0, pages 218-220 "Microsoft Excel User's Guide," version 3.0 for Windows, pages 186-191
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |