- TIPS & TRICKS/
- Power Query: Clean Messy Data in Excel Without a Single Formula/

- TIPS & TRICKS/
- Power Query: Clean Messy Data in Excel Without a Single Formula/
Power Query: Clean Messy Data in Excel Without a Single Formula

Every recurring report starts the same way: a system export lands, and someone spends twenty minutes fixing it by hand before the real work can begin. The same banner rows deleted, the same "N/A"s tidied, the same dates that refuse to sort. Next month, the same twenty minutes.
Power Query, built into Excel since 2016, fixes this class of problem properly. You record the clean-up once, as a list of steps, and every future version of the export replays those steps in one click. No formulas, no macros. This walkthrough cleans a genuinely messy file end to end and finishes with that one-click refresh. Every screenshot is from the real build, and every number in the prose is on screen in the shots.
What you'll need before you start
Desktop Excel 2016 or later (all Microsoft 365 versions qualify). Power Query lives on the Data tab, in the Get & Transform Data group; there is nothing to install.
A messy export of your own: inconsistent capitalisation, junk rows, dates stored as text, anything a system emails you on a schedule.
About 20 minutes.
Time-saver: pick your highest-value candidate first. That's whichever export you or your team clean by hand every single week or month, because the payoff of this technique is proportional to how often the mess comes back.
The file we're cleaning
Our worked example is a web-shop order export from BrightOffice, a fictional office-supplies wholesaler: 128 August orders that arrive buried in classic export mess. Two banner rows before the headers. Four completely blank rows. A City column typed four different ways (LONDON, London, lowercase london, and "London" with stray spaces). A Status column mixing Complete and lowercase complete with three different stand-ins for "we don't know": N/A, none, and empty cells. Dates stored as text. Amounts stored as text with £ signs and commas. Plus two columns nobody asked for, Internal ref and Notes.
All of it is visible above: LONDON in the first data row, a lowercase london further down, a none and a lowercase complete in the Status column, left-aligned dates (Excel's tell for text), and row 21 entirely blank. Close this file after admiring the damage; we won't edit it by hand, and that's the point.
Step 1: Point Power Query at the file
Open a new, blank workbook. This matters: the export stays untouched on disk, and the cleaning recipe lives in your workbook, which is what makes next month's refresh possible. Now Data, then Get Data, then From File, then From Excel Workbook, and pick the export file.
The Navigator dialog shows what's inside. Select the Export sheet and look at the preview: the banner text sits in the first column with null padding beside it, exactly the junk we're about to deal with. Click Transform Data, not Load; Load would drop the mess straight into your workbook as-is.
The Power Query Editor opens: your data with the warts showing, and a Query Settings pane on the right whose Applied Steps list holds just Source and Navigation. The status bar reads 9 columns, 135 rows. Only 128 of those rows are orders; the other 7 are the banner, the header line and the blanks.
Step 2: Strip the noise
Four moves, about a minute in total.
First: Home, Remove Rows, Remove Top Rows, and type 2 to drop the banner and the "Generated" line.
Second: Home, Use First Row as Headers, so Column1 becomes Order ID and friends. Third: Home, Remove Rows, Remove Blank Rows. Fourth: Home, Choose Columns, and tick only the seven columns that matter, which drops Internal ref and Notes in one go (it lands in Applied Steps as Removed Other Columns).
Seven columns, 128 rows, real headers. Notice what's building on the right: every move is a named line in Applied Steps. Click any earlier step and the grid shows the data as it was at that point; delete a step and the decision is undone. Nothing has touched the export file itself.
Step 3: Make the text consistent
Select the City column, then Transform, Format, Trim, and then Format again, Capitalize Each Word. Repeat both on the Status column.
Trim strips the stray spaces, so " london" and "London " both collapse to plain london and London; Capitalize Each Word then settles the case, turning LONDON and london into London. And a side effect we actively want: the lowercase complete statuses become Complete in the same pass, so one variant problem is already gone.
The stand-in values need Replace Values instead. Right-click the Status column, choose Replace Values, and replace N/A with Unknown.
Repeat for None (Capitalize Each Word already promoted the lowercase none). That handles the written stand-ins, 17 cells in this file. The sneaky ones are the 4 cells with nothing in them at all: leaving Value To Find empty only matches empty text, and a truly empty cell is null, a different thing. Run one more Replace Values and type the literal word null as the value to find. Now all 21 unknowns read Unknown, and a filter or PivotTable will treat them as one group instead of three.
Step 4: Fix the data types
Look at the icon on each column header: ABC means text, 123 means whole number, a calendar means date. Order date is still ABC, which is why those dates were left-aligned in Excel and why they won't sort or plot on a timeline.
Select Order date, then Transform, Data Type, Date. (If Excel asks about locale, pick English (United Kingdom); these are day-first dates.) Then select Amount and set Data Type to Currency; the £ signs and thousands commas parse cleanly.
Dates snap right-aligned as real dates and Amount becomes a number you can actually sum. The Applied Steps pane now reads as a fifteen-step recipe, built in roughly five minutes of clicking. That pane is the real product here; the cleaned grid is just its current output.
Almost every "my total looks wrong" and "my dates won't sort" problem in Excel is a type problem underneath. Text that looks like a number sums to zero; text that looks like a date sorts alphabetically. Fixing types in the query means they arrive fixed, every time, for everyone downstream.
Step 5: Load it back into Excel
Click Home, Close & Load. The cleaned data lands on a new sheet as a proper Excel Table, and the Queries & Connections pane reports the number that matters: 128 rows loaded.
Every city is now one of five clean values, every status one of four, and the Amount column sums to £128,926.33, a figure the text-typed original could not produce at all. This table is ready for a PivotTable, a chart, or a straight copy into the monthly report.
The payoff: next month is one click
A month later the next export lands. Same filename, same folder, now 247 orders deep with September included, six blank rows, and every flavour of mess faithfully back. Ignore all of it. Open your workbook and click Data, Refresh All.
247 rows loaded. The banner is gone, the blanks are gone, the cities and statuses are consistent (46 unknowns standardised this time), the types are set, and you did none of it by hand. The twenty minutes is now zero, this month and every month after.
Common gotchas (and the fixes)
A step errors after new data arrives. Almost always a column renamed or removed at the source. Click the failing step in Applied Steps and read the message; the fix is usually renaming the column back at the source, or editing the step (gear icon) to match the new name.
Replace Values missed some blanks. The empty-versus-null distinction from step 3. An empty Value To Find matches empty text only; truly empty cells are null and need the literal word null typed as the value to find. If a filter still shows a blank group after your replaces, this is why.
Dates come out with day and month swapped. A locale mismatch: a US-formatted source read with UK settings, or vice versa. Delete the type step, then use Transform, Data Type, Using Locale, and name the source's format explicitly.
The editor feels slow on a big file. The editor works on a preview sample (the status bar says so: column profiling is based on the top rows). Build the steps on the sample; the full file processes when you Close & Load, and speed there is rarely a problem below a few hundred thousand rows.
You just cleaned it for the last time
One import, four kinds of fix (rows, columns, text, types), one Close & Load: a 135-row wall of export mess became a 128-row table you can trust, and the September version cleaned itself. The same recipe works on bank exports, CRM dumps, ticket logs, anything that arrives messy on a schedule.
If your team still tidies the same exports by hand every week, our one-day Excel Power Query Introduction course teaches exactly this workflow hands-on, on realistic files, with a trainer in the room for the moment a step goes red.
See our Excel Power Query courseCourses related to this article
- Microsoft ExcelExcel Power Query IntroductionThis one-day course is ideal for anyone looking to simplify data cleaning and transformation in Excel. You'll discover how to filter, reshape, and consolidate data from multiple sources to create streamlined workflows and extract valuable insights for your team.1 Day · Classroom or on-site
- Microsoft ExcelExcel AdvancedAdvance your Excel skills in this one-day course, designed for those already comfortable with spreadsheets. Gain practical tools for automating tasks, handling complex datasets, and visualising results, so you can analyse and present data with ease for your team or organisation.1 Day · Classroom or on-site
Ready to train your team?
Tell us what you need and we'll come back to you with a detailed quote.
- Tailored contentBuilt around your team's work and skill levels.
- Flexible schedulingDates and times that suit your team, not ours.
- Your place or onlineDelivered at your office or virtually.
- Better value per headOne trainer, one day, your whole team.
- A dedicated trainerYour team gets all of the trainer's attention.
- Your own filesWe can use your data as the worked examples.
We reply with available dates and a price for your team. No obligation.
Related Articles
Tips & TricksCan you Calculate Variance Using Excel?
In this guide, we explain variance as a measure of how widely data points deviate from the mean and shows why understanding this spread is useful for deeper insight and risk assessment. It walks readers through calculating variance in Excel, distinguishing between the VAR.S function for a sample and VAR.P for an entire population, then demonstrates each with a car-sales case study.
Tips & TricksHow to Use Excel Lookup with Multiple Criteria
This blog explains how Excel’s LOOKUP functions—particularly XLOOKUP and VLOOKUP—can retrieve data based on multiple criteria. It walks through a step-by-step example of finding an employee’s sales in a specific region, showing both an XLOOKUP formula and a VLOOKUP alternative that uses a helper column.
Tips & TricksExcel Skills Self-Assessment Questionnaire
This free, printable Excel Skills Self-Assessment helps you quickly gauge your level and pick the right next step in your learning path. It contains 15 multiple-choice questions spanning navigation, formulas, lookups, tables, PivotTables, charts, dynamic arrays, Power Query, and more. You’ll score yourself and interpret the result to see whether you’re Beginner, Intermediate, or Advanced - then follow tailored course recommendations based on your score.
Insights for modern teams
Stay ahead with our latest learning trends, tools, and success stories. Enter your email address below to receive updates from us.

