Combine seconds and nanos as days

Turn Protobuf Duration seconds and nanos into a signed number of days.

What you'll make

In Excel: 178215 s, 500000000 ns becomes 2.062679 days.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8/86400Whole seconds turned into days: 86,400 in a day.2.062674
2B8/86400000000000Adds the nanoseconds as a tiny part of a day.2.062679

Read it left to right. A minus on both fields gives a negative time. Excel counts time in days.

=A8/86400+B8/86400000000000

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 fields. Paste each row's seconds and nanoseconds into the green columns of the Template tab. The days fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Keep these results as plain numbers. Excel shows #### for a negative time in a time format.