Help with millisecond truncation in date formatting.

mark_ca

New Member
Joined
Mar 2, 2016
Messages
2
I am importing a date from an external file and extracting numbers from the string for calculation purposes, however Excel seems to have a different agenda for me. I have a date value of "12/27/2015 02:43:20.775 PM" but the cell value becomes "12/27/2015 02:43:21 PM" when I try and call the value from the cell. I have attached a screenshot below. I need to retain the information provided by the milliseconds.

I have tried both workarounds suggested by https://support.microsoft.com/en-us/kb/875526 without success. Any suggestions would be appreciated.

DLTUcNu.png
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Don't see a problem, except the formula bar shows a value rounded to seconds.
However, the cell value displays the value in milliseconds, so that should be fine.
You can verify by subtracting the value in C2 from 12/27/2015 2:43:21 PM which returns a tiny value equivalent to 225 milliseconds.
 
Upvote 0
Don't see a problem, except the formula bar shows a value rounded to seconds.

That's the whole problem. If I use a macro to pull the value from cell C2, the string in the macro becomes what is shown in the formula bar, ie: "12/27/2015 2:43:21 PM", and I lose all information regarding the 0.775 of a second which I need to retain.
 
Upvote 0
That's the whole problem. If I use a macro to pull the value from cell C2, the string in the macro becomes what is shown in the formula bar, ie: "12/27/2015 2:43:21 PM", and I lose all information regarding the 0.775 of a second which I need to retain.
You didn't mention macro / VBA... :rolleyes:
 
Upvote 0

Forum statistics

Threads
1,225,385
Messages
6,184,645
Members
453,250
Latest member
unluckyuser

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top