I have this table in Numbers:
In the first column I want to calculate the differences between the timestamps in the third column. The first four entries in the first column are fine. I just subtract the previous row from the current row (e.g.,

=C3-C2
), but that doesn't work when going past midnight between row 4 and 5. If I use the same formula as above I get a negative value because 01:31 is less than 23:12. I tried adding 24h or 1d etc to that calculation, but it returned unexpected results.
If I used DUR2HOURS
, as seen in the screenshot, I can add 24 and get a valid result but instead the number format in the cell is, as you can see, screwed up. I have tried changing the cells format from automatic
to time
or duration
, but it just, automatically, reverts to automatic
.
Adding 24 is stupid because it requires me to manually do that for every midnight in the table.
**How do I handle midnight as well as fix the format of the time difference in the first column?**
The end goal is to plot the values in the second column (12,3 etc) against the their "relative" timestamp. That is, 12,3 starts at zero on the x-axis, the first 12,7 at 3h 41m on the x-axis, the second 12,7 at 4h 08m (3h41m + 27m) on the x-axis etc. In other words, the distance on the x-axis is irregular.
Asked by d-b
(3494 rep)
Mar 8, 2025, 12:24 AM
Last activity: Aug 6, 2025, 01:02 PM
Last activity: Aug 6, 2025, 01:02 PM