Data validation with a fixed amount of decimal places
Dave Peterson wrote...
....
or
=--TEXT(A1,"0.000")=A1
....
Guaranteed not to work when users enter, e.g., 1.500, 3.250, etc., in
which case Excel will dutifully evaluate A1 as text as "1.5" or "3.25"
for these two sample entries, and those won't equal "1.500" or
"3.250".
The only way to ensure users enter 3 and only 3 decimal places every
time involves giving the entry cell the number format Text, so Excel
would store EXACTLY what the user entered.
However, it looks to me like the OP just needs to format the entry
cell with 3 decimal places. If s/he also needs to use these entries as
though they include 3 decimal places, then all references to the entry
cell need to be wrapped in TEXT calls, e.g., to refer to X99,
=TEXT(X99,"0.000")
or
=TEXT(X99,"0.000############")
|