How to Apply Conditional Formatting for Time Differences Over One Hour in Excel
Question details
The user needs to calculate work or break durations and use conditional formatting to highlight the cells in red when the calculated time difference exceeds one hour.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating break durations from start and end times in a spreadsheet.
- Observed behavior
- Times entered with decimal points (e.g., 13.30) are treated as standard numbers rather than valid time values, causing duration formulas and conditional formatting to fail.
Ensure all time values are entered using a colon (e.g., 13:30) rather than a decimal point so the spreadsheet program correctly recognizes them as time values.
Calculate Duration and Apply Time-Based Conditional Formatting
Correct your time formatting, calculate the time difference, and use the TIME function in a custom conditional formatting rule.
Excel handles time internally as a fraction of a 24-hour day. Because of this, standard integer comparisons will not work for time formats. Utilizing the built-in TIME function guarantees accurate condition triggers.
Verify that your start and end times are entered using a colon. For example, replace '13.30' with '13:30'.
In a new cell, subtract the start time from the end time. For instance, enter the formula =B2-A2 (where B2 is the End Time and A2 is the Start Time).
Highlight the range of cells containing your calculated durations that you wish to format.
Navigate to the 'Home' tab, click 'Conditional Formatting', select 'New Rule', and choose 'Use a formula to determine which cells to format'.
In the formula bar, type =C2>TIME(1,0,0) (assuming C2 is the first cell in your selected range). Click the 'Format' button, choose a red fill color, and click 'OK' to apply.

Calculate and Format Time Data Effortlessly with WPS Spreadsheet
WPS Office offers a fully-featured, free spreadsheet application that perfectly handles complex time calculations and conditional formatting just like Microsoft Excel, ensuring your workflow remains smooth and uninterrupted.
- 1. Open your worksheet: Launch WPS Spreadsheet and open the document containing your start and end times.
- 2. Calculate the time difference: Ensure times use colons, then subtract the start time from the end time (e.g., =B2-A2).
- 3. Access Conditional Formatting: Highlight the duration cells, go to the 'Home' tab, and click 'Conditional Formatting'.
- 4. Apply the rule: Select 'New Rule', use the formula =C2>TIME(1,0,0), set your desired cell background to red, and click 'OK'.

Frequently Asked Questions
Why is my time difference showing hashes (####) or a negative error?
If an end time crosses midnight and is technically smaller than the start time on the same day, Excel displays hashes (####) for negative time. To fix this, adjust your formula to =(EndTime-StartTime)+(EndTime<StartTime) to account for the day crossover.
Can I use '>1' in the conditional formatting rule instead of the TIME function?
No. Excel treats the whole number 1 as an entire 24-hour day. Using '>1' checks if the duration is greater than 24 hours, not one hour. You must use '>TIME(1,0,0)' or '>1/24' for one hour.
How do I format time differences over 30 minutes instead of one hour?
You can adjust the parameters within the TIME function. To highlight durations over 30 minutes, change your conditional formatting formula to =C2>TIME(0,30,0).




