logo
search
Calculation Issues

How to Calculate SLA Working Hours with Formula in Excel

Maira MehtabMaira Mehtab Sep 27, 2026 871 views

Question details

The user needs to calculate the exact business minutes between a support call and a technician's arrival, excluding non-working hours, weekends, and public holidays.

Product
Excel
Device & OS
not provided
Scenario
Tracking Service Level Agreement (SLA) compliance by calculating exact business minutes for issue resolution.
Observed behavior
Calculating raw time difference yields incorrect SLA data because it includes nights, weekends, and holidays.
Before you start

Ensure your start and end dates contain both date and time values, and set up a dedicated range of cells listing your specific public holiday dates.

Solution 1Recommended

Use Nested IF and WEEKDAY Formula for SLA Calculation

Calculate total business minutes by evaluating start and end dates against a defined schedule and holiday list.

This formula breaks down the calculation into same-day responses versus multi-day responses. It uses the WEEKDAY function to determine different daily working schedules (e.g., shorter hours on weekends) and checks a predefined range for public holidays.

1
Set up your source data

Ensure cell A2 contains the start date/time, cell B2 contains the end date/time, and cells E2:E27 list your company's holiday dates.

2
Select the result cell

Click on the cell where you want the SLA minutes displayed (e.g., C2).

3
Enter the formula

Type the formula exactly as follows: =IF(INT(A2)=INT(B2),(B2-A2),IF(OR(WEEKDAY(A2,2)=7,INT(A2)=$E$2:$E$27),16/24-MOD(A2,1),IF(WEEKDAY(A2,2)=6,17/24-MOD(A2,1),18/24-MOD(A2,1)))+(MOD(B2,1)-8/24))*24*60

4
Format and apply

Press Enter to execute the formula. Format the result cell as a 'Number' rather than a date to view the total elapsed business minutes.

Customize Working Hours: Adjust the fractional values in the formula (like 16/24 for 4:00 PM, 17/24 for 5:00 PM, or 8/24 for 8:00 AM) to match your company's actual operating hours.
Efficient SLA Calculation

Calculate Complex SLAs Seamlessly in WPS Spreadsheet

WPS Spreadsheet fully supports advanced date and time functions, allowing you to track SLA compliance accurately. Easily set up custom working hours and holiday lists with a familiar, user-friendly interface.

  1. 1. Open your SLA workbook: Launch WPS Spreadsheet and open the document containing your SLA logs.
  2. 2. Format date and time cells: Right-click your date columns, choose 'Format Cells', and ensure they are set to a custom format that displays both date and time (e.g., yyyy/mm/dd hh:mm).
  3. 3. Apply the calculation formula: Paste the SLA nested IF formula into your target cell and press Enter to instantly calculate the business minutes.
  4. 4. Drag to fill: Click and hold the fill handle at the bottom right corner of the cell, then drag it down to automatically calculate SLA times for all recorded support calls.
Fully compatible with Microsoft Excel formulas and date/time formats.Built-in date calculation templates to simplify SLA tracking.Free and lightweight, loading large datasets instantly.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my SLA calculation return a negative number?

This usually happens if the end date is earlier than the start date, or if the start time is outside the standard working hours specified in the formula. Verify your data entries to ensure they fall within business hours.

Can I use the NETWORKDAYS function for SLA calculation instead?

Yes, if you only need to calculate full business days. However, NETWORKDAYS cannot calculate exact hours and minutes natively without combining it with complex fractional arithmetic.

How do I adjust the formula if my business operates 24/7?

For a 24/7 schedule, you do not need to subtract non-working hours or weekends. You can simply use the formula =(B2-A2)*24*60 to get the total elapsed minutes.

Why does the formula multiply the result by 24 and 60?

Spreadsheet software stores time as a fraction of a day. Multiplying by 24 converts the fraction into total hours, and multiplying by 60 converts those hours into minutes.