Automatically Calculate Durations and Extend Formulas in Excel
Question details
The user needs a method to calculate time durations in a specific column and wants the formula to automatically update and apply to any newly added rows without manual intervention.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Entering new data records into a worksheet where a duration formula needs to be calculated automatically for every new entry.
- Observed behavior
- The user wants to avoid manually dragging or copying the duration formula down every time a new row of data is inserted into the worksheet.
Ensure that your start and end times are properly formatted as 'Time' or a custom time format (such as h:mm) so that the mathematical calculation for duration works accurately.
Convert the Data Range into an Excel Table
Formatting your data range as an Excel Table is the most efficient and reliable way to ensure that formulas automatically extend to new rows as you type.
Excel Tables have a built-in feature called 'Calculated Columns'. When you enter a formula into one cell of a table column, Excel automatically applies that formula to the entire column. Furthermore, when you add a new row to the bottom of the table, the formula will automatically extend to the new row.
Highlight the range of cells containing your existing data, making sure to include your column headers.
Navigate to the 'Home' tab on the Excel ribbon, click on 'Format as Table', and choose your preferred visual style from the dropdown gallery.
A prompt will appear asking to confirm your data range. Ensure the 'My table has headers' checkbox is selected and click OK.
Click on the first data cell in column D (or your target duration column), type your formula (e.g., =C2-B2), and press Enter. The formula will instantly populate down the entire column and automatically apply to any new rows you add.

Use the Fill Handle to Copy Formulas Manually
If you prefer not to convert your raw data into an official Excel Table, you can manually copy your formula down using the Fill Handle.
Automatically Calculate and Extend Formulas with WPS Spreadsheet
WPS Spreadsheet provides a seamless way to handle automated calculations. By utilizing its Smart Table features, your duration formulas will dynamically extend to new rows without repetitive manual dragging.
- 1. Open your dataset: Launch WPS Spreadsheet and open your workbook.
- 2. Format as Table: Select your data range, go to the Home tab, and click 'Format as Table' to enable smart data grouping.
- 3. Input the formula: Type your duration formula into the target column's top cell and press Enter.
- 4. Add new rows dynamically: Type new data in the row immediately below the table; WPS Spreadsheet will automatically copy the formula down.

Frequently Asked Questions
Why isn't my formula extending to new rows automatically in the table?
This usually occurs if the AutoCorrect option for calculated columns is disabled. To fix this, go to File > Options > Proofing > AutoCorrect Options. Click the 'AutoFormat As You Type' tab, and ensure the box for 'Fill formulas in tables to create calculated columns' is checked.
How do I correctly write a formula to calculate time duration?
To calculate a basic time duration, simply subtract the start time from the end time (e.g., =C2-B2, where C2 is the End Time). Ensure both the source cells and the result cell are formatted using a Time format or a Custom format like 'h:mm'.
Can I stop an Excel Table from automatically filling formulas?
Yes. Immediately after you enter a formula and press Enter, an AutoCorrect Options smart tag (a small lightning bolt icon) will appear next to the cell. Click it and select 'Stop Automatically Creating Calculated Columns'.




