Search code examples
libreoffice-calc

How to subtract a time constant in LibreOffice calc


I want to subtract 8 hours from a cell with a time in it (HH:MM)

I want to track whether I work more than 8 hours, or less than 8 hours each day. If I work more, I should get a POSITIVE HH:MM result. If I work less, I should get a NEGATIVE HH:MM result.

Here is what the spreadsheet should end up looking like: enter image description here

A similar question was asked here, but I discovered the 'accepted' answer doesn't cover all cases. How to subtract a time constant in a LibreOffice/OpenOffice/Excel formula?


Solution

  • The following custom format code works for me:

    HH:MM;[RED]-HH:MM

    enter image description here