How to Keep Excel Formulas Updated When Adding or Deleting Rows
Question details
The user needs formulas that transfer data to other worksheets to automatically include new rows or prevent errors when rows are inserted or deleted, eliminating the need to drag formulas manually.

- Product
- Excel / WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Modifying source data rows that are being referenced by formulas in other worksheets.
- Observed behavior
- Formulas stop including new rows or produce #REF! errors after rows are inserted or deleted, currently requiring the user to manually drag and update the formulas.
Before making bulk changes to your spreadsheet, identify which formulas heavily rely on the specific data range you plan to modify, as deleting referenced rows can instantly trigger #REF! errors.
Convert Data Range to an Excel Table
Converting your static data range into a dynamic Table allows structured references to expand and contract automatically whenever rows are modified.
Using an Excel or WPS Spreadsheet Table is the most efficient way to manage dynamic data. Because Tables use structured references instead of static cell ranges (like A1:A10), any formulas connected to a Table column will automatically adjust when new rows are added or existing ones are deleted.
Highlight the entire range of source data that you want your formulas to reference.
Navigate to the 'Insert' tab on the top ribbon and click 'Table', or press the keyboard shortcut Ctrl+T. Confirm that your table has headers if prompted.
Modify your existing formulas on other worksheets to point to the new Table name and columns (e.g., =SUM(Table1[Sales])) rather than the old static range.

Clear Contents and Re-sort Instead of Deleting Rows
Avoid #REF! errors entirely by clearing the cell contents rather than deleting the actual worksheet rows.
Lock Ranges Using the INDIRECT Function
Use the INDIRECT function to lock a formula's reference as a text string, preventing it from breaking when rows are shifted.
Automate Formula Updates with WPS Spreadsheet
WPS Spreadsheet provides seamless support for dynamic tables and advanced formula management, ensuring your data calculations stay perfectly accurate when inserting or deleting rows. It offers a highly compatible environment for handling complex worksheets without the hassle of manual formula dragging.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your source data and dependent formulas.
- 2. Create a dynamic table: Select your source data and press Ctrl+T or navigate to Insert > Table to convert the range into a smart, dynamic table.
- 3. Apply structured references: Update your formulas to reference the table columns, ensuring automatic data calculation whenever new rows are added or removed.

Frequently Asked Questions
Why do I get a #REF! error when deleting rows in Excel?
A #REF! error occurs because the formula is trying to refer to a specific cell or row that has been permanently deleted from the worksheet. Clearing the cell contents using the 'Delete' key on your keyboard, instead of deleting the entire row, prevents this error.
Does adding rows at the bottom of my data break my VLOOKUP formulas?
If you insert rows outside the specified VLOOKUP table array range (e.g., below the final row of a static range), the formula won't include the new data. Using dynamic Tables or selecting entire columns (e.g., A:D) ensures new rows are always included in your lookups.
What is a structured reference in spreadsheet formulas?
A structured reference is a special syntax used with Tables (e.g., Table1[Sales]). It allows formulas to automatically adjust based on the table's actual data size, eliminating the need to update ranges manually when rows are added or deleted.
Can I use the OFFSET function to handle dynamic rows instead of Tables?
Yes, combining the OFFSET function with COUNTA allows you to create dynamic named ranges that automatically expand or contract as data is added or removed. This keeps dependent formulas updated without manual adjustments, though it can impact performance in very large sheets.




