How to Rename a Query in Excel: Step-by-Step Guide
In this article
Renaming a query in Excel is quick: open the Queries & Connections pane, right-click the query, choose Rename, type the new name, and press Enter. You can also rename it from the Power Query Editor by editing the Name property in the Query Settings pane. This changes only the query's label, not the data or the steps inside it.
What You'll Need
- Excel with Power Query (Excel 2016 or later, or Microsoft 365). The exact labels can differ slightly by version, device, or region.
- A workbook that already contains at least one query. If you have none, import data first via Data > Get Data.
- For the desktop method: the Queries & Connections pane visible. If it is not, go to Data > Queries & Connections.
Step-by-Step
- Open the workbook that contains the query you want to rename.
- On the Data tab, click Queries & Connections to show the pane on the right side of the window.
- In the pane, find the query under the Queries section. If it is inside a group, expand the group first.
- Right-click the query name and choose Rename. On some versions, you can also click the name once to select it, then click it again to edit it directly.
- Type the new name and press Enter. The name updates in the pane immediately.
- If you prefer to work inside the editor, select the query and click Data > Edit (or right-click and choose Edit). The Power Query Editor opens.
- In the editor, look at the Query Settings pane on the right. If it is hidden, go to View > Query Settings to show it.
- In the Name box under Properties, replace the current name with the new one and press Enter.
- Click Close & Load (or Close & Load To) to return to Excel. The renamed query appears in the Queries & Connections pane and in the worksheet if it loads to a table.
Common Mistakes
- Renaming the output table instead of the query. The table name and the query name are separate. Changing the table header or the table name on the Design tab does not rename the query.
- Using a name that already exists. Excel does not allow two queries with the same name in the same workbook. If the name is taken, choose a different one.
- Including characters that cause problems. Avoid names with periods, brackets, or leading/trailing spaces. Underscores and hyphens are safe.
- Expecting formulas or pivot tables to update automatically. If a formula or PivotTable refers to the old query name, it may break. Check dependent items after renaming.
- Renaming a query that is used by another query. If Query B references Query A, renaming Query A can break Query B's steps. Update the dependent query's steps or rename carefully.
Tips
- Use descriptive names that indicate the source and purpose, such as Sales_2024_Raw or Customers_Cleaned. This makes the Queries & Connections pane easier to scan.
- Rename queries before building reports or dashboards that depend on them, to avoid broken references later.
- If you rename a query that loads to a worksheet table, the table itself keeps its own name. You can rename the table separately on the Table Design tab.
- Keep names short enough to read in the pane; very long names get truncated in the interface.
- If you use the Power Query Editor often, rename there for consistency, since the Name property is the same as the pane name.
Troubleshooting
- The Rename option is grayed out. The query may be part of a group that is protected or the workbook may be read-only. Check the workbook's protection status and unprotect if needed.
- The name change does not stick. Make sure you press Enter after typing, and that the workbook is not in a state where changes are blocked (for example, a shared workbook with restrictions).
- A dependent query shows an error after renaming. Open the dependent query in the Power Query Editor and update any step that refers to the old name. The step may show the old name in the formula bar; edit it to the new name.
- Formulas return #REF! after renaming. Formulas that reference the query by name need updating. Use Find & Replace (Ctrl+H) to replace the old name with the new one in formulas, or edit the formulas directly.
- The Queries & Connections pane is empty. The workbook may have no queries, or the pane is filtered. Check that you are looking at the correct workbook and that the pane is not set to show only connections.
- You renamed the query but the worksheet table still shows the old name in the header. The table header is separate from the query name. Edit the header cell directly if you want it to match.
Frequently Asked Questions
Does renaming a query change the data?
No. Renaming only changes the label. The data, steps, and connections remain the same.
Can I rename a query in Excel Online?
Excel for the web has limited Power Query support. The full Queries & Connections pane and Power Query Editor are available in the desktop app. For reliable renaming, use Excel desktop.
What happens if I rename a query that is used in a PivotTable?
The PivotTable may lose its connection to the query. You may need to refresh or recreate the PivotTable after renaming. Check the PivotTable's data source settings.
Can I use spaces in a query name?
Yes, spaces are allowed, but they can make formulas harder to read. Underscores are often a better choice for names used in formulas.
How do I rename a query that is in a group?
Expand the group in the Queries & Connections pane, then right-click the query and choose Rename. The group name itself is renamed separately by right-clicking the group.
Is there a keyboard shortcut to rename a query?
There is no dedicated shortcut. You can select the query in the pane and press F2, which often works for renaming in list views, but the right-click Rename method is the most reliable.