How do I extract a value from a time formatted value in excel?

With a time in cell A1, use:

=RIGHT(TEXT(A1,"hh:mm:ss.000"),3)

yields milliseconds as text, and if you need it as a number:

=RIGHT(TEXT(A1,"hh:mm:ss.000"),3)*1

(the second formula gives the number of milliseconds as an integer)

Similar formulas can capture hours or minutes or seconds as integers.


This will return the fraction of the seconds as an integer:

=MOD(A1*86400,1)*1000

The Mod removes everything but the fraction of the second and the * 1000 causes it to be an integer.


Looks like there are lots of neat ways to do this. Here is another:

=(B8-TIME(HOUR(B8),MINUTE(B8),SECOND(B8)))*86400*1000

Where time is in cell B8.