View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default count of digit in a number

You can use this formula. It counts the number of digits for the number in
cell A1. Note that it counts the number of digits entered, not the number of
digits displayed. for instance if the number is formatted to show 2 decimals
and the number 5 is enetered, the cell will show 5.00, but since only 1 digit
was entered the formula will return 1...

=IF(ISERROR(FIND(".",A1)), LEN(ABS(A1)), LEN(ABS(A1))-1)

also I assume you don't count the decimal as a digit, nor the negative sign.
--
HTH...

Jim Thomlinson


"SHIRA" wrote:

does anyoone know if there is a function that count the number of digit in a
number?