=MOD(A1*86400,1)*1000
--> 679
When I enter 14:32:05.679 in a cell, the MOD function results in
678.999999996449 when formatted as Number with 15 significant digits,
which Excel treats as different from 679. At a minimum, I would do:
=round(mod(A1*86400,1),0)
However, Angus does not explain the origin of the timestamps. If it
is a function similar to NOW(), the timestamp includes a "serial
number" (days since 12/31/1899 on non-Macs). In that case,
multiplying by 86400 is likely to exceed the MOD limit of
134217727+0.9999995. That could be avoided by:
=round(mod(mod(A1,1)*86400,1),0)
Alternatively, the following remedies all of thes problems:
=--right(text(A1,"ss.000"),3)
PS: It appears that with Excel 2003 on MS Win XP, the resolution of
NOW() is indeed milliseconds, not less. The fractional digits in the
result from MOD(MOD(A1,1)*86400,1) is due to "numeric
error" (aberration) when NOW() is computed by serialNumber + hr/24 +
min/1440 + sec/86400 + msec/86400000. At least, that is how I
duplicated exactly the internal representation of NOW(). (But
sometimes, it requires VBA, which seems to provide 80-bit FP precision
over the entire expression).