Fix Excel Formulas Not Referencing Newly Inserted Rows
Question details
Formulas fail to automatically update and include newly inserted rows when a macro adds data to the top of an output sheet.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Running a macro to insert rows into a data sheet and relying on formulas on another sheet to calculate the data.
- Observed behavior
- Formulas continue using old ranges or shift incorrectly, ignoring the newly inserted data rows.
Check if calculation options are set to automatic and ensure your macro is functioning without runtime errors before adjusting formula ranges.
Use Entire-Column References
Change fixed range references to entire columns so that inserted rows are automatically included in calculations.
By referencing an entire column rather than a specific set of rows, any new row inserted by a macro will automatically fall within the calculation range. This is highly effective for functions like SUMIFS or COUNTIFS.
Click on the cell containing the formula that is failing to include the newly inserted data.
Look at the formula bar and locate the fixed range causing the issue, such as 'Expenses Output'!$H$6:$H$100.
Modify the row numbers to reference the full column. For example, change the range to 'Expenses Output'!$H:$H.
Press Enter to apply the updated formula. Run your macro again to verify that the new rows are now successfully calculated.

Adjust Starting Rows in Fixed Ranges
Update formulas to start above the row where new data is inserted to capture shifts.
Seamlessly Manage Dynamic Data and Formulas with WPS Office
WPS Spreadsheet offers powerful formula calculations, full compatibility with Excel functions, and smooth macro execution. Easily handle entire-column references and dynamic ranges without performance drops.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file where your macro inserts new rows.
- 2. Select the formula: Navigate to the worksheet and click the cell containing the formula that needs updating.
- 3. Modify the range: Change the specific row references to an entire-column reference (e.g., $H:$H) in the formula bar and press Enter.
- 4. Run the macro: Execute your macro to verify that the newly inserted rows are automatically included in the calculation.

Frequently Asked Questions
Why do my Excel formulas change when a row is inserted?
When a row is inserted inside a referenced range, Excel automatically expands the range. However, if the row is inserted exactly above or outside the boundary of the defined range, the formula shifts down to accommodate the new row, which can exclude the new data.
Does using entire-column references slow down Excel?
Yes, functions like SUMPRODUCT or array formulas evaluate every single cell in the column (over a million rows), which can significantly impact calculation speed. However, SUMIFS and COUNTIFS are generally optimized to handle whole columns efficiently.
How can I make my macro update the formulas automatically?
You can modify your VBA macro code to rewrite the formulas dynamically after inserting the row. Alternatively, use the macro to convert the data range into an official Excel Table (ListObject), which forces dependent formulas to update automatically.
What is the best way to handle dynamic ranges without using whole columns?
Using Excel Tables (Insert > Table) is the most robust method. You can also use dynamic named ranges with the OFFSET and COUNTA functions, which allow formulas to automatically expand when new rows are added without referencing the entire column.




