Fill Missing Excel OutTime and Calculate Time Difference in WPS Spreadsheets
Question details
The user needs to calculate elapsed time when some OutTime cells are blank by substituting the InTime value in a helper column, without overwriting existing OutTime entries or creating a circular reference.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- A timesheet or attendance log contains InTime and OutTime columns; blank OutTime values must be treated as equal to InTime for rows where the out time is missing.
- Observed behavior
- Direct calculation against blank OutTime cells produces incorrect elapsed time, and entering the substitution in the original OutTime column risks overwriting data or creating a circular reference.
Confirm that the InTime and OutTime columns use a consistent date/time format, and identify the exact cells for the helper and elapsed time columns so the formulas do not overwrite original data.
Use a Helper Column to Substitute Missing OutTime and Calculate Elapsed Time
Best when you need to keep the original OutTime column intact and avoid circular references.
A helper column checks each OutTime cell and uses the InTime value only when OutTime is blank. This lets you calculate elapsed time without modifying the source attendance data.
In cell D2, next to the first row of data, type =IF(C2="",B2,C2) and press Enter, where B2 is InTime and C2 is OutTime.
Select D2 and drag the fill handle down through the last time entry row, or double-click the fill handle to apply the formula to the adjacent data range.
In cell E2, enter =D2-B2 and press Enter, then fill the formula down through the same number of rows.
Select the elapsed time cells, press Ctrl+1, choose Custom under Category, enter [h]:mm in the Type box, and click OK.

Permanently Populate Blank OutTime Cells with Helper Values or VBA
Use this when you have verified the helper calculation and need to physically fill only the blank OutTime cells.
Calculate Elapsed Time with a Helper Column in WPS Spreadsheets
WPS Spreadsheets supports Excel-compatible IF formulas and custom [h]:mm formatting, so you can fill missing OutTime values, calculate elapsed time, and keep your original attendance data intact.
- 1. Open the timesheet in WPS Spreadsheets: Launch WPS Office, open the .xlsx workbook, and click the worksheet that contains the InTime and OutTime columns.
- 2. Enter the helper-column formula: Click the helper cell next to the first OutTime row, type =IF(C2="",B2,C2), and press Enter.
- 3. Calculate and format elapsed time: In the next column, enter =D2-B2, select the results, press Ctrl+1, choose Custom, enter [h]:mm, and click OK.
- 4. Save the workbook: Press Ctrl+S or click Menu > Save to keep the workbook in Excel-compatible .xlsx format.

Frequently Asked Questions
Why does my time difference show a negative value when OutTime is blank?
A blank OutTime cell is treated as zero, so subtracting InTime from zero returns a negative time. Use =IF(C2="",B2,C2) in a helper column to substitute InTime only when OutTime is blank.
Can I use ISBLANK instead of ="" in the helper formula?
Yes. In WPS Spreadsheets, =IF(ISBLANK(C2),B2,C2) works for truly empty cells; =IF(C2="",B2,C2) also handles formula cells that return an empty string.
How do I format elapsed time as [h]:mm in WPS Spreadsheets?
Select the result cells, press Ctrl+1, choose Custom, type [h]:mm in the Type box, and click OK.
Will pasting helper results over OutTime overwrite existing times?
It can if you paste over the whole column. Select only rows where OutTime is blank, or paste into a copy of the worksheet to preserve existing values.
Does this helper column formula create a circular reference?
No. The helper formula references only InTime and OutTime, not the helper column itself, so it avoids a circular reference.




