I am searching for an Excel formula to get the amount of significant figures from a decimal number or integer (I realized that cell needs to be string to have trailing zeros)
For example:
from an integer I can do:
=len("113")
which has 3 sig. digits
also for a decimal number >=1 or < 1 I can cut out the dots: Let's say H19 has 1.13 inside:
=IF(VALUE(H19)>=1;LEN(SUBSTITUTE(H19;".";""));LEN(SUBSTITUTE(H19;"0.";"")))
This formula give me 3 sig. digits or let's say 0.13 will give me 2 sig. digits as "0." will be removed from string.
Can I somehow include all possible cases which can occur let's say: "0.000300"? "300" are the sig. digits so 3 is the result.
With my formula it would not correctly work.
A second problem is, my formula now works only if someone uses a dot as decimal separator but it breaks with a comma. Unfortunately it really has to be a formula and not a macro.
I googled a lot but I couldn't find a solution to cover all aspects. Can someone help?