How to Create an Excel Formula to Increment Days After 5 PM
Question details
The user needs an Excel formula to calculate the number of whole days that have passed since 5:00 PM on a specific date, conditional on another cell containing the letter 'N'.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking elapsed time or days for conditional tasks, such as tracking overdue items past a 5:00 PM deadline.
- Observed behavior
- Requires a dynamic calculation that updates the elapsed whole days only when a specific text condition is met, outputting 0 if the condition is false.
Ensure your spreadsheet's calculation options are set to 'Automatic' so the NOW() function updates correctly whenever the workbook is opened or recalculated.
Use the IF, INT, NOW, DATE, and TIME Functions
This is the most readable and standard way to calculate elapsed days after a specific time based on a condition.
This method combines several date and time functions. The NOW() function captures the current date and time. By subtracting your target date and specific time (5:00 PM) from NOW(), you get the elapsed time. The INT() function strips away partial days to return only whole numbers, and the IF() function ensures the calculation only runs when your specific text condition is met.
Click on the empty cell where you want the number of elapsed days to be displayed.
Type the formula: =IF(B1="N",INT(NOW()-DATE(2024,8,20)-TIME(17,0,0)),0). Adjust 'B1' to match the cell containing your condition, and modify the DATE(YYYY,M,D) parameters to match your target deadline.
Press the Enter key. The cell will now display the elapsed whole days past 5:00 PM on the specified date, provided that cell B1 contains the letter N.

Use Date and Time Fractions
An alternative, slightly shorter formula that uses mathematical fractions to represent time instead of the TIME function.
Master Date and Time Formulas with WPS Spreadsheet
WPS Office provides a highly compatible and powerful Spreadsheet tool that perfectly handles complex Excel formulas like IF, NOW, and DATE. It offers a familiar interface, making it easy to create and manage conditional time-tracking sheets for free.
- 1. Download and Install: Download WPS Office for free from the official website and install it on your device.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheet and create a new blank workbook or open your existing Excel (.xlsx) file.
- 3. Apply the Formula: Select the desired cell and input your formula, such as =IF(B1="N",INT(NOW()-DATE(2024,8,20)-TIME(17,0,0)),0), exactly as you would in Excel.

Frequently Asked Questions
Why does my formula return a decimal instead of a whole number of days?
The NOW() function includes both the current date and the precise current time. If you omit the INT() function in your formula, the subtraction will result in a decimal representing partial days. Wrap your calculation in INT() to discard the fraction and return only completed whole days.
How can I change the reference date without modifying the formula manually?
Instead of hardcoding the DATE function (e.g., DATE(2024,8,20)) directly into the formula, you can type your target date into a separate cell like A2. Then, update your formula to reference that cell: =IF(B1="N",INT(NOW()-A2-TIME(17,0,0)),0). This allows you to easily change the deadline directly from the spreadsheet interface.
Why isn't the number of elapsed days updating continuously on my screen?
Spreadsheet applications do not update the NOW() function every second like a live digital clock. The formula only recalculates when a change is made to the workbook or when you manually trigger a recalculation by pressing the F9 key.




