To open an existing query in Excel for Microsoft 365 on Windows, go to Data > Queries & Connections, then double-click the query or right-click it and choose Edit. Excel opens the query in Power Query Editor, where you can inspect its source, change its steps, and control how its results are loaded. You’ll need a workbook that contains a query, or access to the workbook where that query is saved.
What You’ll Need
- Excel for Microsoft 365 on Windows for the steps below. Power Query features and available data sources can vary by Excel version and platform.
- A workbook containing an existing query. If the query is in another workbook, open that workbook first. A table of imported results alone does not always mean the query is still available in that file.
- Permission to edit the workbook and access its data source. You may need credentials or network access to view or refresh data from a protected source.
Step-by-Step
- Open the workbook that contains the query. If Excel displays a yellow security bar or asks whether to enable connections, macros, or external content, follow your organization’s rules before allowing access. You do not need to refresh the data just to open the query editor, but an unavailable source may affect previews or refreshes.
- Open the Queries & Connections pane. On the ribbon, select Data > Queries & Connections. The pane normally opens along the right side of the workbook. If the command is not visible, maximize the Excel window or look for it in the Data tab’s query-related controls; ribbon layout can vary with window size and updates.
- Find the query in the pane. Select the Queries tab if the pane offers separate tabs for queries and connections. Read the names carefully: a workbook can contain several queries, and some may be used as inputs for other queries. A query’s name is not necessarily the same as the worksheet tab or table name where its results appear.
- Open the query for editing. Double-click its name, or right-click the name and choose Edit. Power Query Editor opens in a separate window. If you only want to inspect the output already in the workbook, click the worksheet containing the results instead; opening the query editor is for viewing or changing how those results are obtained.
- Check the preview and the Applied Steps list. The central area shows a preview of the data at the selected step. On the right, Query Settings usually shows the query name and Applied Steps, such as Source, Changed Type, or Filtered Rows. Select a step to see the preview at that point. Some previews show only a sample, so do not assume they display every row in the source.
- Make the change you need, if any. Select a step to inspect its settings, use the gear icon beside a step when available to revise its options, or use the ribbon to add a transformation. For example, use Home > Remove Rows to remove rows, or select a column and choose a relevant command on Transform to change its data. Review the preview after each change. To remove a step, select its X in Applied Steps; later steps may depend on it, so check the resulting preview before proceeding.
- Apply your changes or leave without applying them. To send the query results back to Excel, choose Home > Close & Load. If you need to choose where the results go or whether to create a table or connection, use the Close & Load drop-down and select Close & Load To when available. To exit without keeping edits, close the editor and choose the discard option if Excel asks whether to save changes. Avoid discarding if you are unsure; cancel the prompt and review your work instead.
When you apply an edit, Excel updates the query definition and may refresh its output. A query set to load as a connection only may not create or update a visible worksheet table. If you changed settings rather than the transformation itself, inspect the load destination before concluding that nothing happened.
Common Mistakes
- Confusing query results with the query itself. A worksheet table is the output; the query is the set of instructions that imports and transforms data. Editing cells in the output table usually does not change those instructions, and a refresh can overwrite manual edits to query-generated results.
- Choosing Refresh instead of Edit. Refresh updates the results using the current query. It does not open the editor or let you change transformation steps. Use the query’s Edit command when you need to inspect or revise the query.
- Editing the wrong query. Similar names, staging queries, and queries that feed other queries can make the list confusing. Check the preview and source before changing anything, especially if several outputs rely on the same query.
- Removing a step without checking what follows. Applied Steps run in sequence. Later steps may refer to a column or value created earlier; removing that earlier step can cause errors downstream. If an error appears, undo the change where possible or restore the deleted step and revise a later one instead.
- Assuming Close & Load always creates a new sheet. Excel can load to an existing worksheet, a new worksheet, or a connection, depending on the query’s settings. Check Close & Load To and the query’s load behavior if you cannot find the output.
- Refreshing before checking credentials or source access. A query can open even when its source is unavailable, but a refresh may fail because a file moved, a server is offline, or sign-in details expired. Confirm the source and permissions before repeatedly refreshing.
Tips
- Make a copy before substantial edits. Use File > Save As to create a working copy, particularly when a query supplies reports or other queries. That gives you a straightforward way to return to the original workbook.
- Change one thing at a time. After each transformation, inspect the preview and the Applied Steps list. This makes it easier to identify which edit caused a problem and helps preserve a clear sequence of steps.
- Use descriptive query names. Names such as MonthlySales or CleanedCustomers are easier to identify than Query1. You can rename a query in Query Settings without changing its source data; if other queries refer to it, keep dependencies in mind.
- Distinguish opening, editing, and refreshing. Double-click or choose Edit to open the editor. Make changes and close and load to apply them. Choose Refresh when you want to retrieve updated source data using the existing query instructions.
- Expect platform differences. On Excel for Mac, Power Query support and the available connectors or editing commands depend on the Microsoft 365 update and source type. Check the Data tab for Get Data (Power Query) and the query list. Excel for the web can work with some queries and refresh scenarios, but it does not offer the same full Power Query editing experience as Excel for Windows. If Edit is missing, try the desktop Windows app.
Troubleshooting
The Queries & Connections command or pane is missing. Confirm that you are using the desktop version of Excel and that the workbook is open in the Excel app, not just a browser. Maximize the window, select the Data tab, and look for the command in the query-related area. If the workbook is in an older file format, save a copy as an Excel workbook (.xlsx) and check again. If you are on Mac or the web, feature availability may differ from Windows.
The pane is empty, or the query is not listed. You may have opened a workbook that contains only a copied or exported results table, rather than the original query. Check whether the query is in another workbook, and confirm you are viewing the Queries list rather than only connections. If the file was shared or moved, ask its owner for the version containing the query definition.
Edit is unavailable or the editor will not open. Check that you selected a query rather than a connection entry, and that you have permission to edit the workbook. A protected workbook, an unsupported source, or a platform limitation can restrict editing. Save and reopen the file in a current desktop version of Excel for Windows, then try again. If the workbook is shared, coordinate edits so another person’s changes are not overwritten.
The preview is blank, incomplete, or shows an error. Select different Applied Steps to find where the issue begins. Check the source path, network connection, permissions, and credentials. A preview may represent only a sample; use a refresh to check the full query result when appropriate. If a column was renamed or removed in the source, revise steps that refer to its old name.
Close & Load does not put results where expected. Look for the query output on another worksheet and check whether the query is set to connection-only or to load to an existing destination. Open Close & Load To if available to inspect the selected destination. If Excel reports that the destination range is occupied, choose a different location or clear the conflicting cells only after confirming they contain nothing you need.
Frequently Asked Questions
How do I open a query without changing it?
Open it with Data > Queries & Connections, then double-click the query or choose Edit. Inspect the preview and steps, then close the editor and discard any accidental changes if prompted.
What is the difference between Edit and Refresh?
Edit opens Power Query Editor so you can inspect or alter the query’s instructions. Refresh reruns the existing instructions to retrieve current data; it does not open the editor.
Can I open a query from its worksheet table?
Use the Queries & Connections pane to locate the query that created the table. Clicking or editing the table itself does not reliably open the query, and manual changes to query output may be replaced on refresh.
Can I open and edit a query in Excel for the web?
Excel for the web supports some query-related viewing and refresh tasks, but it does not provide the same full query-editing tools as desktop Excel for Windows. Open the workbook in the desktop app if you need the full Power Query Editor.
Will opening a query update its data?
Opening the editor is primarily for inspecting or editing the query. A preview may retrieve data, and applying changes or choosing Refresh can run the query. If you only need to inspect its steps, avoid refreshing unless you are ready to access the source.
Related
- How to Insert a Table of Citations in Word
- How to Insert a Solid Line in Word: 3 Easy Methods
- How to Insert a Straight Line in Word: 3 Easy Methods
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Import CSV to Excel: Steps, Settings, and Common FixesTo import a CSV file into Excel for Microsoft 365 on Windows, open a blank workbook and choose…
- Simple Project Timeline in Excel: Build a Clear ScheduleA simple project timeline in Excel is a task list with start and finish dates, paired with calendar…
- Insert a Personal Signature in Word Online: Steps and TipsYes. In Word Online, the most reliable way to insert a personal signature is to add it as…
- How to Set an Out of Office Reply in OutlookTo set an out of office reply in Outlook, open Automatic Replies for your email account, write your…
- Excel Auto Insert Row When Data Changes?No: Excel does not automatically insert a new worksheet row every time data changes. For a list that…
- How to Add Headers in Excel on SharePoint and Format ThemTo add column headers to an Excel workbook stored in SharePoint, open the workbook for editing, enter a…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.