Calculate Date and Time Differences in Separate Excel Columns
Question details
Calculate elapsed time from dates and times stored in separate spreadsheet columns.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An operational report keeps start and end dates and times in separate fields.
- Observed behavior
- The user needs a duration without merging the date and time fields into single cells.
Check that Excel recognizes the date and time entries as dates and times rather than text. Identify the start and end columns and confirm that the end date and time occur after the start.
Subtract the combined start and end values
Use this formula to calculate elapsed time across dates, including durations longer than one day.
For this example, place the start date in A2, start time in B2, end date in C2, and end time in D2.
Select an empty result cell, enter =(C2+D2)-(A2+B2), and press Enter. Adjust the cell references to match your worksheet.
Select the result cell, press Ctrl+1 to open Format Cells, choose Custom, and enter [h]:mm in the Type field. Click OK.
Drag the result cell's fill handle down to calculate durations for the remaining rows.

Calculate a time-only difference that wraps at midnight
Use MOD when only the time fields matter and the elapsed duration is known to be less than 24 hours.
Calculate Separate Date and Time Fields in WPS Spreadsheets
Use WPS Spreadsheets to subtract separate start and end date and time fields, then format the result as total elapsed hours.
- 1. Open the worksheet: Open WPS Spreadsheets and choose Open to load your workbook.
- 2. Check the fields: Locate the start date and time and the end date and time. For example, use A2 and B2 for the start and C2 and D2 for the end.
- 3. Calculate the difference: Select an empty cell and enter =(C2+D2)-(A2+B2), adjusting the references if needed.
- 4. Format elapsed hours: Open Format Cells for the result, choose Custom, and enter [h]:mm as the format.
- 5. Fill down and save: Drag the result cell's fill handle down for other rows, then use File > Save to save the workbook.

Frequently Asked Questions
How do I calculate elapsed time across midnight in Excel?
Include both dates and times in the formula, such as =(C2+D2)-(A2+B2), where A2 and B2 are the start date and time and C2 and D2 are the end date and time.
Why does my duration reset after 24 hours?
A standard time format can display only the time within a day. Open Format Cells, choose Custom, and use [h]:mm to display total elapsed hours.
Can I calculate the difference using only the time columns?
Yes. Use =MOD(D2-B2,1) for a duration known to be less than 24 hours, including a time range that crosses midnight. The formula ignores dates and cannot account for full days.
Why does the formula return an error?
Check that the referenced cells contain valid Excel dates and times rather than text. Re-enter text values as dates or times, and confirm that the formula points to the correct cells.




