← All how-to recipes

How to calculate hours worked minus a break

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

Timesheet math: end time minus start time minus the unpaid break, as decimal hours for pay.

The formula

AppFormulaNotes
Excel (desktop)=(C2-B2-D2)*24B2=start, C2=end, D2=break duration (as a time like 0:30). Format the result as a Number.
Google Sheets=(C2-B2-D2)*24Identical.
LibreOffice Calc=(C2-B2-D2)*24Identical.

How it works

Times are day-fractions, so (end − start − break) gives the worked portion of a day, and ×24 converts it to decimal hours: 9:00 to 17:00 minus a 30-minute lunch is 7.5 hours — the number you multiply by an hourly rate. Format the result cell as Number (it inherits time formatting otherwise). For overnight shifts wrap the difference in MOD(C2-B2,1) so crossing midnight doesn't go negative.

Verified, not just documented

We ran =(TIME(17,0,0)-TIME(9,0,0)-TIME(0,30,0))*24 in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 7.5 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 7.5 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.