Asking too much of Excel?
Keep it as text and modify as follows:
=IF(ISERROR(FIND(".",A1)),0,LEN(A1)-FIND(".",A1))
Ithaca wrote:
This works well, with only a couple of issues popping up relating to
reference cell formatting. The functionality has inspired me to expand it's
use for a wider range of reference values, down to two decimal places.
If the reference cell is formatted as text this equation works for any
number of decimals but fails for whole numbers (due to lack of a decimal
point in the cell). A simple workaround is typing "1." but when I push this
out for use by the rest of the group I know I'll get frantic call about it
not working due to them not putting in the decimal. My goal would be to have
something that an idiot could work...
I tried switching the cell format to "general" or "custom" and it works for
integers now but fails for decimals with a (significant to me) trailing zero.
Every attempt I've made with formatting the cell drops the "insignificant"
zero at the end of my decimal (e.g. 0.30) and gives me the result for the
single decimal input.
Is there a way to get around this? Can I format the cell to keep the
trailing zero, if entered, AND not mess with the format of other inputs (1=1
not 1.00)? Am I asking too much of Excel with this?
"Luke M" wrote:
You could do something like this:
=IF(INT(A1)=A1,0,LEN(A1)-FIND(".",A1))
to get you the amount of decimals entered.
NOTE: This depends on actual number entered, not how number is formatted.
Inputing "1" and formatting as number with two decimals, the formula will
still return 0.
You could then use this number in a INDEX or LOOKUP function, to return the
correct number to use in rest of calculation.
--
Best Regards,
Luke M
*Remember to click "yes" if this post helped you!*
|