Read long Unix time codes kept as text

Turn 1793802615123456 microseconds into 11/4/2026 2:30:15.123 PM UTC.

What you'll make

In Excel: Unix microseconds 1793802615123456 becomes 11/4/2026 2:30:15.123 PM.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1IF(LEN(A8)>n, … ,"0")All but the last n digits, or 0. LET calls it w."1793802615"
2RIGHT(REPT("0",n)&A8,n)The last n digits, the part of a second. LET calls it f."123456"
3DATE(1970,1,1)+VALUE(w)/86400Adds the whole seconds to January 1, 1970.11/4/2026 2:30:15 PM
4VALUE(f)/(86400*10^n)Adds the last digits as part of a second.… 2:30:15.123 PM
5LET( … )Names each step so the formula reads in order.… 2:30:15.123 PM

LET calls the unit in B8 n: 6 for microseconds, 9 for nanoseconds. The cell shows 3 of the digits.

=LET(n,B8,w,IF(LEN(A8)>n,LEFT(A8,LEN(A8)-n),"0"),f,RIGHT(REPT("0",n)&A8,n),DATE(1970,1,1)+VALUE(w)/86400+VALUE(f)/(86400*10^n))

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own codes. Paste codes like 1793802615123456 and their unit, 6 or 9, into the green columns of the Template tab. The dates and times fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Paste the codes as text. Typed as a number, Excel turns the last digits into zeros.

Microsoft's help: VALUE function