View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Lenght of a decimal part of a number.

Hi, I am doing some programming where I need to know the number of
digits of the only decimal part of a number. . . .

...
In cell B1 I wrote the following : =LEN(A1-INT(A1))


Use

=LEN(ABS(A1))-LEN(INT(ABS(A1)))-(A1<INT(A1))

instead.


Here is a shorter formula which also appears to work...

=MAX(0,LEN(A1)-FIND(".",A1&"."))

Rick