Read duration text like -2.01:30:15

Turn day.hh:mm:ss text, as .NET systems export it, into a signed number of days.

What you'll make

In Excel: -2.01:30:15 becomes -2.062674 days.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1IF(LEFT(A8,1)="-", … )Drops a leading minus. LET calls the rest t."2.01:30:15"
2IFERROR(--TEXTBEFORE( … ),0)Takes the days before the dot, or 0. LET calls it days.2
3IFERROR(TEXTAFTER( … ),t)Takes the clock time after the dot. LET calls it clockText."01:30:15"
4IF( … )*( … )Adds the days and clock time, then puts the minus back.-2.062674
5LET( … )Names each step so the formula reads in order.-2.062674

head is the text before the first colon (2.01). Excel counts time in days.

=LET(t,IF(LEFT(A8,1)="-",MID(A8,2,99),A8),head,TEXTBEFORE(t,":"),days,IFERROR(--TEXTBEFORE(head,"."),0),clockText,IFERROR(TEXTAFTER(t,"."),t),IF(LEFT(A8,1)="-",-1,1)*(days+TIMEVALUE(clockText)))

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 durations. Paste durations like -2.01:30:15 or 01:30:15 into the green column 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.

Microsoft's help: LET function