Excel Queries Explained: Create, Edit and Refresh Power Query
Learn what Excel queries are, how to create one with Power Query, edit it in the Queries & Connections pane, combine queries, and set up refresh on any platform.
When people say “Excel queries” they almost always mean Power Query (called Get & Transform in Excel 2016 and later), the built-in tool that pulls in data, cleans it up with steps you can repeat, and loads the result into a sheet. You start one from the Data tab’s Get & Transform Data group, and you manage your queries from Data > Queries & Connections.
Below is how queries work, how to make and edit one, how to combine them, and what works on Windows, Mac and the web as of November 2026.
What an Excel query actually is
A query is a saved list of steps. It connects to a source, such as a table in the same workbook, a CSV file, a folder or a database. Then it applies changes like removing columns, filtering rows or changing data types, and it outputs the result.
Because the steps are saved, you don’t redo the cleanup next month. You refresh the query and it runs every step again on the new data.
Microsoft’s create, load, or edit a query page explains that when you create a query, Excel also creates connection information behind the scenes. The query’s job is to shape the data. That is why the side pane is called Queries & Connections.
How to create a query
The most common way is to import data. You can also start from a blank query.
From a table or range in the same workbook
- Click any cell inside your data.
- Go to Data > Get & Transform Data > From Table/Range.
- If the range isn’t already an Excel table, Excel turns it into one. The new query stays linked to that table.
- The Power Query Editor opens. Make your changes, such as removing columns or filtering rows.
- Choose Home > Close & Load to send the result to a new worksheet.
From a file, folder or database
- Go to Data > Get Data and pick the source type, for example From File > From Text/CSV.
- Browse to the source and confirm the preview.
- Choose Transform Data to open the editor first, or Load to bring the data in as it is.
The sources you can use depend on your Excel version and platform. Microsoft keeps a table of them on its Power Query data sources in Excel versions page. Check it before you plan around a specific connector.
Loading options: worksheet, Data Model or connection only
After shaping the data, you usually load it to a worksheet or to the Data Model. If you used Close & Load and want a different destination:
- Open Data > Queries & Connections and go to the Queries tab.
- Right-click the query and choose Load To.
- Choose a table in a worksheet, a PivotTable, the Data Model, or Only Create Connection.
| Load option | Good for |
|---|---|
| Table in a worksheet | Data you want to see, filter or chart directly |
| Data Model | Large data or related tables feeding PivotTables |
| Only Create Connection | Helper queries that only feed a merge or append |
“Connection only” is a good choice for staging queries. It keeps your workbook from filling up with tables nobody needs to look at.
Editing and managing queries
The Queries & Connections pane is where you look after everything. Microsoft’s Manage queries page says you can create, edit, refresh and delete connections there. In newer versions this pane replaces the old Workbook Connections dialog box.
To edit a query, right-click it in the pane and choose Properties, then go to the Definition tab and select Edit Query. This reopens the Power Query Editor.
Applied Steps and M code
In the editor, the Applied Steps list on the right shows every change in order. You can click a step to see the data at that point, rename it, or delete it.
Behind the scenes, each step is written in M, Power Query’s formula language. Microsoft’s M quick tour describes how a query is built:
- A query is a
letblock of named steps, followed by aninclause that returns the result. - Each step refers to the step before it by name. Step names in Applied Steps are the same as the variable names in the code.
- M is case-sensitive, so
Table.SelectRowsworks andtable.selectrowsdoesn’t.
The formula bar shows the M for whichever step is selected. Home > Advanced Editor shows the whole query. The ICAEW’s introduction to M is a friendly next step if you want to start editing code by hand.
Combining queries: Merge vs Append
The Queries tab offers two ways to combine data. People often mix them up.
| Operation | What it does | Similar to |
|---|---|---|
| Merge | Joins one query to another using matching values in one or more columns | A lookup or SQL join |
| Append | Adds the rows of one query under another to make one combined query | Stacking tables |
Use Merge to bring customer names into an orders table. Use Append to combine January, February and March exports that share the same columns.
Refreshing queries
Manual refresh is the simplest option. Use Data > Refresh All, or right-click a single query in the pane and choose Refresh.
For automatic refresh, open the query’s Properties from the Queries & Connections pane. Microsoft’s Connection properties page lists the settings under Refresh control on the Usage tab:
- Refresh every n minutes: refreshes on a timer, set in whole minutes.
- Refresh data when opening the file: runs the query each time the workbook opens.
- Enable background refresh: lets you keep working while the query runs.
A few things to know:
- Timed refresh only runs while the workbook is open. Excel Off The Grid’s auto-refresh guide goes through other options, including scripted ones, if you need more.
- Experts disagree about background refresh. Some leave it on so Excel stays responsive. Others turn it off so dependent queries and formulas run in a predictable order. If your results look stale or out of order, try turning it off.
Windows, Mac and web: what works where
Power Query is most complete in Excel for Windows. The other platforms have caught up a lot but still have gaps. This is the picture as of November 2026, and it changes often:
| Platform | Create and edit queries | Refresh |
|---|---|---|
| Excel for Windows (Microsoft 365, 2016 and later) | Full Power Query Editor | Full, including timed and on-open refresh |
| Excel for Mac (Microsoft 365) | Through Data > Get Data | Many sources, but Microsoft lists Data Model queries and gateway sources as not supported yet |
| Excel for the web | Limited; the full editor is not available on the web yet | Workbook sources, anonymous OData and selected authenticated sources |
For the web, Microsoft’s Excel blog announcement says refresh is now available for selected authenticated sources. Credentials are managed in Data Source Settings. You can refresh with Data > Refresh All or from the Queries pane. Microsoft has said it plans to bring the full Power Query experience to the web but hasn’t given a public timeline. If your team works in the browser, build and maintain queries in desktop Excel for now.
Practical tips that save time later
- Name your queries and steps clearly. “Sales_Clean” and “Removed blank rows” are much easier to debug six months later than “Query1” and “Custom2”.
- Use connection-only staging queries for the raw imports. Build your final output on top of them with Merge or Append.
- Check where the source lives. A query that points to a file on your own drive will fail for a colleague. Shared locations travel better between people.
Free apps worth trying
SponsoredSponsored links. Installing through them can earn us a commission, at no cost to you. Apps are free to download; some offer optional in-app purchases.
Frequently asked questions
Where are queries in Excel? +
Go to Data > Queries & Connections to open the side pane that lists every query in the workbook. New queries start from the Get & Transform Data group on the Data tab (Get Data on Excel for Mac).
Can I use Power Query on a Mac? +
Yes, Microsoft 365 subscribers get Power Query on Mac through Data > Get Data. Some limits remain: Microsoft says refreshing queries loaded to the Data Model, and sources that need an on-premises data gateway, are not supported on Mac yet.
Do Excel queries refresh automatically? +
Only if you turn it on. In the query's Properties dialog you can tick refresh every n minutes or refresh data when opening the file. The timed refresh only runs while the workbook is open in desktop Excel.
What is the difference between a query and a connection? +
The query holds the steps that shape your data, and Excel creates the connection details in the background when you make it. Both show up and are managed in the Queries & Connections pane.
Do I need to learn M code to use queries? +
No. Each click in the Power Query Editor is written as an M step for you. Learning a little M helps when you want to fix or reuse a step in the Advanced Editor.
Sources
- Create, load, or edit a query in Excel (Power Query) (support.microsoft.com)
- Manage queries (Power Query) (support.microsoft.com)
- Power Query data sources in Excel versions (support.microsoft.com)
- Connection properties (support.microsoft.com)
- New in Excel for the web: Power Query refresh from data sources (techcommunity.microsoft.com)
- Quick tour of the Power Query M formula language (learn.microsoft.com)
- A short introduction to Power Query M code (icaew.com)
- How to auto refresh Power Query in Excel (6 ways) (exceloffthegrid.com)