Fix Excel Query Data Showing #N/A Until Table Is Selected
Question details
Excel formulas referencing a Power Query table display #N/A errors after a refresh, which only resolve when the queried table is manually clicked or selected.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Refreshing Power Query data that feeds into dependent lookup formulas like XLOOKUP.
- Observed behavior
- Dependent tables and formulas show #N/A after refresh. The data only calculates correctly after the user opens the sheet with the imported table or selects a cell within it.
Ensure your Excel workbook calculation options are set to Automatic and that you have saved a backup copy of your file before modifying query refresh settings.
Disable Background Refresh for the Power Query Connection
Preventing the query from refreshing in the background ensures Excel waits for the data to fully load before calculating dependent formulas.
When background refresh is enabled, Excel may attempt to calculate your XLOOKUP formulas before the Power Query data has finished loading, resulting in #N/A errors. Disabling this forces Excel to complete the data refresh before triggering workbook calculations.
Navigate to the Data tab on the Excel ribbon and click on 'Queries & Connections' to open the side pane.
Right-click on the specific query causing the issue in the pane, and select 'Properties' from the context menu.
In the Query Properties dialog box, uncheck the box labeled 'Enable background refresh'. Click OK to save your changes.
Go back to the Data tab and click 'Refresh All' to verify that the formulas now update correctly without requiring manual selection.

Match Data Types in Power Query and XLOOKUP
Lookup formulas will return #N/A if the lookup value format (like text) doesn't perfectly match the Power Query output format.
Manually Force a Full Workbook Calculation
Manually triggering a full calculation tree rebuild can force Excel to recognize the newly imported query data if automatic calculation fails.
Switch to WPS Office for Reliable Data Processing
If you frequently encounter complex calculation bugs and background refresh issues in Microsoft Excel, consider trying WPS Office. It provides a lightweight, highly compatible alternative for your spreadsheet needs with a stable formula calculation engine.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package.
- 2. Install and Open: Run the installer, launch WPS Spreadsheet, and open your existing .xlsx workbooks directly.
- 3. Enjoy Seamless Editing: Experience smooth formula calculations and data lookups without unexpected #N/A refresh errors.

Frequently Asked Questions
Why do my XLOOKUP formulas show #N/A after a Power Query refresh?
This usually happens because Excel evaluates the XLOOKUP formulas before the Power Query background refresh has finished retrieving the data. It can also occur if the data types (e.g., text vs. numbers) do not exactly match between your lookup value and the queried column.
How do I stop Power Query from refreshing in the background?
Navigate to the Data tab, click 'Queries & Connections', right-click your specific query, and select 'Properties'. In the Usage tab, uncheck the 'Enable background refresh' option and click OK.
Does clicking the table recalculate the formulas?
Yes. When you click on the imported table or select a cell within it, Excel's calculation engine is often prompted to recognize the newly loaded data, which forces the dependent #N/A formulas to finally evaluate correctly. Disabling background refresh prevents you from having to do this manual click.




