Forum Discussion

ajan9626's avatar
ajan9626
Copper Contributor
Jan 03, 2024
Solved

How to convert my unique time format to excel time format

Hey party people,   I have a particular way that I record time in a text editor throughout the day. I would rather be putting these times into excel for further calculations. I use a style of time ...
  • PeterBartholomew1's avatar
    Jan 03, 2024

    This formula requires 365.

    = LET(
        pm,    IF(RIGHT(timeInput,1)="p", 0.5, 0),
        n,     LEN(timeInput),
        h,     IF(n<4, LEFT(timeInput, n-1), LEFT(timeInput, n-3)),
        m,     IF(n<4, 0, MID(timeInput, n-2, 2)),
        time,  TIME(h, m, 0) + pm,
        start, TAKE(time,,1),
        end,   TAKE(time,,-1),
        duration, MOD(end - start, 1),
        HSTACK(time, duration)
      )

    and returns time as a fraction of a day but formatted as "[h]:mm".

Resources