Calculation Issues

How to Apply Conditional Formatting for Time Differences Over One Hour in Excel

Khadija KhanKhadija Khan Nov 11, 2026 869 views

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.

How to Apply Conditional Formatting for Time Differences Over One Hour in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Format time entries correctly

Verify that your start and end times are entered using a colon. For example, replace '13.30' with '13:30'.

2
Calculate the duration

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).

3
Select the duration data

Highlight the range of cells containing your calculated durations that you wish to format.

4
Create a new formatting rule

Navigate to the 'Home' tab, click 'Conditional Formatting', select 'New Rule', and choose 'Use a formula to determine which cells to format'.

5
Enter the TIME formula

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 Duration and Apply Time-Based Conditional Formatting
Understanding Excel Time Fractions: Because Excel stores one hour as 1/24 (approximately 0.04166667) of a day, comparing a time cell to the number '1' actually compares it to 24 hours. The TIME(hours, minutes, seconds) function automatically translates your desired duration into the correct fraction.
Efficient Spreadsheet Tool

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. 1. Open your worksheet: Launch WPS Spreadsheet and open the document containing your start and end times.
  2. 2. Calculate the time difference: Ensure times use colons, then subtract the start time from the end time (e.g., =B2-A2).
  3. 3. Access Conditional Formatting: Highlight the duration cells, go to the 'Home' tab, and click 'Conditional Formatting'.
  4. 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'.
100% compatibility with Microsoft Excel (.xlsx) formats and time functionsIntuitive Conditional Formatting menu for quick data highlightingFree, lightweight, and fast-loading across multiple platformsBuilt-in robust calculation engine prevents data interpretation errors
microsoft office alternative - wps office

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).