Automatically Expand a Total Row for New Excel Rows
Question details
Create a total that automatically includes new rows inserted above it in Excel.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user adds data rows above a total row and wants the total to include the new values without editing the formula.
- Observed behavior
- The desired total should expand to include values in newly inserted rows.
Identify the column to total and its first data row. The examples below assume values begin in cell B2, with the total below the data.
Use an Excel Table with a Total Row
Use a Table Total Row to include new table rows automatically.
Select the data range, including its headers but excluding any existing total row, and press Ctrl+T. Confirm the range and select My table has headers if applicable.
Click inside the table, open the Table Design tab, and check Total Row.
Click the Total Row cell under the column you want to add, open its drop-down menu, and select Sum.
Insert a table row above the Total Row and enter its values. The table and its total will expand to include the new row.

Use a Dynamic SUM Formula Outside a Table
Use this formula when you want to keep a regular worksheet range instead of converting it to a table.
Create an Expanding Total in WPS Spreadsheets
Use a dynamic SUM formula in WPS Spreadsheets to include rows inserted above your total.
- 1. Open your spreadsheet: Open WPS Spreadsheets and select your workbook. Identify the column and first row containing the values to add.
- 2. Enter a dynamic total: Click the total cell below the data and enter =SUM(B$2:INDEX(B:B,ROW()-1)) if the values start in B2. Adjust the column and starting row as needed.
- 3. Insert a row: Right-click the total row number and choose Insert. Enter the new value in the corresponding column above the total.
- 4. Verify the total: Check the total cell to confirm that it includes the new value, then use File > Save to save the workbook.

Frequently Asked Questions
How do I add a Total Row to an Excel table?
Click inside the table, open Table Design, and check Total Row. In the total cell for the desired column, select Sum from the drop-down menu.
Will the Excel Total Row include filtered-out values?
A Total Row commonly uses SUBTOTAL, which can exclude rows hidden by a filter. Check the formula in the total cell to see which function it uses.
Can I make the total expand without creating a table?
Yes. If the values start in B2, enter =SUM(B$2:INDEX(B:B,ROW()-1)) in the total cell below them. Insert new rows above the total and below the first data row.
How do I use the formula for a different column?
Replace both references to B with the desired column letter, and change 2 to the first data row. For example, use =SUM(C$3:INDEX(C:C,ROW()-1)) for values beginning in C3.




