Calculation Issues

Fill Missing Excel OutTime and Calculate Time Difference in WPS Spreadsheets

Phi Hung VoPhi Hung Vo Nov 13, 2026 869 views

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.

Fill Missing Excel OutTime and Calculate Time Difference in WPS Spreadsheets
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter the helper formula

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.

2
Fill the helper formula down

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.

3
Calculate elapsed time

In cell E2, enter =D2-B2 and press Enter, then fill the formula down through the same number of rows.

4
Format the result as [h]:mm

Select the elapsed time cells, press Ctrl+1, choose Custom under Category, enter [h]:mm in the Type box, and click OK.

Use a Helper Column to Substitute Missing OutTime and Calculate Elapsed Time
Original OutTime values remain unchanged: The helper column preserves existing OutTime values and uses InTime only for blanks, so there is no overwrite and no circular reference.
WPS Spreadsheets calculation fix

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. 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. 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. 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. 4. Save the workbook: Press Ctrl+S or click Menu > Save to keep the workbook in Excel-compatible .xlsx format.
Handle blank OutTime cells with a simple IF helper columnCalculate elapsed time using Excel-compatible formulasPreserve original time entries and avoid circular referencesOpen, edit, and save .xlsx files with full Microsoft Excel format compatibilityLightweight and easy-to-use interface for daily timesheet tasks
QA img-9

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.