How to Calculate Weekly Hours and Deduct a 45-Minute Break in Excel
Question details
The user needs an Excel formula to accurately sum weekly work hours across multiple days while automatically subtracting a 45-minute break from any day where the total time worked exceeds five hours.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Setting up a weekly timesheet or time-calculation calendar where breaks are automatically deducted without needing manual text conversions.
- Observed behavior
- Timesheets need to perform direct calculations on time values natively stored as fractions of a day, outputting the correct weekly total hours.
Ensure that the cells containing your start and end times are properly formatted as 'Time' (e.g., 08:00 AM) so that Excel can accurately calculate the mathematical differences between them.
Use MOD and IF Functions for Time Calculations
This recommended method calculates the elapsed time between two time values, converts it to decimal hours, and uses an IF statement to conditionally deduct 0.75 hours (45 minutes).
Excel handles dates and times as serial numbers, meaning 1 hour is technically 1/24th of a day. By multiplying the elapsed time by 24, you can convert the result into a standard numerical format (decimal hours).
The MOD function is highly recommended for time calculations because it seamlessly handles night shifts that cross over midnight.
Input a daily start time in cell A2 and an end time in cell B2. Make sure you use standard time formats.
Select cell C2 and enter the base time calculation formula: =MOD(B2-A2,1)*24. This will give you the total elapsed hours without breaks in decimal format.
Modify the formula in cell C2 to include the break rule. Use this exact formula: =MOD(B2-A2,1)*24-IF(MOD(B2-A2,1)*24>5,0.75,0). This tells Excel to subtract 0.75 (which is 45 minutes) only if the initial calculation exceeds 5 hours.
Because we multiplied by 24, the output is a decimal number. Right-click cell C2, select 'Format Cells', and set the format to 'Number' with two decimal places (e.g., 8.25 for 8 hours and 15 minutes).
Click the bottom-right corner of cell C2 and drag it down to apply the formula to the rest of the week's days. Then, in the cell below your last working day, use the AutoSum feature or type =SUM(C2:C8) to calculate your weekly total hours.

Track Work Hours Seamlessly with WPS Spreadsheet
WPS Spreadsheet features robust built-in calculation capabilities that perfectly handle time values, complex IF statements, and conditional arithmetic to help you automate your daily timesheets.
- 1. Open a new worksheet: Launch WPS Office, open WPS Spreadsheet, and create a blank workbook.
- 2. Input the calculation formula: Enter your in/out times and simply paste the time deduction formula =MOD(B2-A2,1)*24-IF(MOD(B2-A2,1)*24>5,0.75,0) directly into the cell.
- 3. Use AutoSum for the week: Highlight your daily hours and click the 'AutoSum' button on the formula ribbon to instantly gather your weekly total.

Frequently Asked Questions
Why is my total hours calculation showing up as a date like '1/0/1900'?
This happens because Excel tries to be smart and assumes the result of a time equation is also a time or date format. To fix this, simply right-click the cell containing your formula, select 'Format Cells', and change the formatting from Date/Time to 'Number' or 'General'.
How do I change the formula to deduct a 30-minute break instead?
Since the formula calculates in decimal hours, 30 minutes is 0.5 hours. Just change the '0.75' in the formula to '0.5'. The new formula would be: =MOD(B2-A2,1)*24-IF(MOD(B2-A2,1)*24>5,0.5,0).
Can I show the weekly total as hours and minutes (e.g., 38:45) instead of a decimal?
Yes. If you prefer the [h]:mm format, remove the '*24' from the formula and deduct the time value instead of the decimal. Use this alternative formula: =MOD(B2-A2,1)-IF(MOD(B2-A2,1)*24>5,TIME(0,45,0),0). Then, format your final cell using the Custom format [h]:mm.




