In Excel: start from Data ▸ Get Data (or Data ▸ From Table/Range) to open the Power Query Editor, shape the data with the ribbon buttons, then Close & Load to drop the result on a sheet.
Data ▸ Get Data and choose the source, or Data ▸ From Table/Range for data already on a sheet.
In the editor, shape the data with the ribbon: Remove Columns, Split Column, Filter, Change Type, Unpivot.
Watch the Applied Steps pane on the right — it is the recipe, and any step can be deleted or reordered.
Set every column's data type explicitly before loading; it is the step most often skipped.
Close & Load, or Close & Load To… if you want a connection only, or a load straight into the Data Model.
Afterwards, Data ▸ Refresh All replays every step against the current source.
What this does
Power Query — shown in the ribbon as Get & Transform — is the import-and-clean layer that sits in front of the worksheet. Its defining property is that it RECORDS every step rather than performing it: removing a column, splitting one, changing a type, filtering rows and unpivoting all land as an ordered list in the Applied Steps pane. Point it at next month's file and click Refresh, and the whole sequence replays. That makes it the correct answer to any cleaning job you will do more than once, and to combining a folder of identically shaped files (Get Data ▸ From File ▸ From Folder). Two operations have no practical worksheet equivalent: Unpivot Columns, which turns a wide twelve-month-columns layout into the tall three-column shape every PivotTable wants, and Merge Queries, a join that handles many-to-many where VLOOKUP cannot. It is built into Excel for Windows from 2016 and into Excel for Mac from 2019, though the Mac version supports fewer connectors. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “unpivot excel table”. Start on a copy or a tiny sample, keep the affected pivot table visible, and compare the result with the tool above before you touch the real workbook. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. The point is a data step that keeps your analysis trustworthy, but the practical win is that someone else can open the file and understand what happened without asking you.
A worked example
Twelve monthly CSV exports in one folder, each with the same headers. Data ▸ Get Data ▸ From File ▸ From Folder ▸ pick the folder ▸ Combine & Transform. Power Query stacks all twelve, and the steps you then add — remove a blank column, set Date to date type, filter out cancelled rows — apply to every file. Next month, drop file thirteen into the folder and press Data ▸ Refresh All. Any cleaning routine you perform more than once is a query you should have built the first time — the second month costs one click instead of an afternoon. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.
In Google Sheets
Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Treat “unpivot excel table” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.
Common mistakes
- Editing the loaded output on the sheet — the next refresh overwrites it. All edits belong in the query.
- Skipping Change Type, so numbers arrive as text and every downstream total is wrong or zero.
- Filtering on a value list, which hard-codes today's values into the step and silently drops new ones later.
- Combining files whose headers differ slightly; the step records column names, so "Amount " with a trailing space breaks the append.
- Loading a million rows to a worksheet instead of Close & Load To ▸ Connection Only ▸ Add to Data Model.
- Building the same clean-up by hand each month when the query already exists and just needs Refresh.
Frequently asked questions
What is Power Query used for?
Importing data from files, folders, databases and the web, and cleaning it with steps that are recorded once and replayed on every refresh.
Where is Power Query in Excel?
On the Data tab as Get Data / Get & Transform. It is built into Excel for Windows from 2016 and Excel for Mac from 2019.
How do I unpivot data?
In the editor, select the columns that should stay, right-click ▸ Unpivot Other Columns. Wide month-per-column data becomes the tall layout PivotTables need.
Can Power Query combine multiple files?
Yes — Get Data ▸ From File ▸ From Folder ▸ Combine & Transform appends every identically shaped file in the folder, and picks up new files on refresh.
Is Power Query better than VLOOKUP?
For repeated joins across whole tables, yes: Merge Queries handles many-to-many and does not recalculate on every edit. For a single lookup in a live formula, XLOOKUP is simpler.