Fix Excel Cell References That Show #REF! After a Power Query Refresh
Question details
The user needs Excel formulas to remain valid when refreshed Power Query output changes the number of rows.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- Worksheet formulas reference cells in a table populated by a Power Query refresh.
- Observed behavior
- After a refresh changes the output size, formulas that refer to deleted or replaced query rows may display #REF!.
Identify the formulas showing #REF! and the query output they referenced. Check whether the query is loaded as an Excel table and whether its column names remain consistent after refresh.
Use structured references to the Power Query output table
Use table and column names instead of references to individual rows that may disappear during refresh.
Select a cell in the query output, open the Table Design tab, and check the Table Name field.
Edit the formula in the formula bar to reference the table and column. For example, use =SUM(QueryTable[Amount]), replacing QueryTable and Amount with your actual table and column names.
Open Data > Queries & Connections, right-click the query, and select Refresh. Check that the revised formula returns the expected result.

Use OFFSET with a stable cell anchor
Use this approach when you need a cell at a fixed position relative to an anchor that the query will not remove.
Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface and Excel format compatibility, making it easy to move everyday spreadsheet work to WPS. It does not repair Microsoft Excel Power Query refresh behavior.

Frequently Asked Questions
Why does a Power Query refresh cause #REF! errors?
A refresh can change the number of output rows. If a formula refers to a cell in a row that is deleted or replaced, Excel may turn that reference into #REF!.
How do I find the name of my query output table?
Select a cell in the output table and open the Table Design tab. The table name appears in the Table Name field.
Will a structured reference find the same record after rows move?
A table reference can follow a named column as the table changes size, but it does not by itself identify a particular record. Use a lookup based on a stable unique ID when you need a specific record.
Can Excel automatically restore a reference that already shows #REF!?
The original reference may no longer be recoverable from the formula. Select the affected cell and edit the formula bar to replace #REF! with the intended table reference or a valid cell reference.




