Power Query in Excel is the tool that cleans a messy CSV file without a single formula. It is a data transformation tool built into modern Excel, and it does almost all of that work for you, automatically, every time the source data changes.
The best part? You do not need to write formulas. Power Query in Excel works through a point-and-click interface. You tell it what to do once, and it remembers. Next month, when you get a fresh export, you just hit Refresh and the whole process runs again.
In this guide, I will walk you through Power Query from scratch: what it is, how to load data, the most useful transformations, and how to build a small repeatable workflow. It is beginner-friendly and does not assume any programming background.

What Is Power Query?
Power Query is a data preparation engine built into Excel (and Power BI). It sits between your raw data and your spreadsheet. When you use Power Query, you are not editing cells directly. You are defining steps, and Excel runs those steps on the data.
The steps are recorded, editable, and repeatable. If you made a mistake on step 3 of 10, you do not need to start over — you can edit step 3 and everything after it recalculates. This is a much safer way to clean data than using manual edits.
Power Query is available in Excel 2016 and later, and in Microsoft 365. If you are using an older version, you may need to install the add-in.
Where to Find It
Power Query in Excel is under the Data tab, in the Get & Transform Data group. You will see options like “From Text/CSV”, “From Workbook”, “From Table/Range”, From Web, and more. These are the starting points for loading data.
Loading Data into Power Query
The most common use case for Power Query in Excel is loading a CSV file. Here is the step-by-step:
Step 1: Go to Data > Get Data > From File > From Text/CSV.
Step 2: Browse to your file and click Open.
Step 3: A preview window appears, showing the first few rows. Check that the delimiter (comma, tab, semicolon) is correct. Excel usually detects it, but you can change it from the dropdown.
Step 4: Click “Transform Data” (not “Load”). This opens the Power Query Editor, where you will do the cleaning work.
The Power Query Editor
The Power Query in Excel editor is a separate window with four main areas:
- The ribbon at the top, with transformation options
- The Queries pane on the left, listing all loaded queries
- The data preview in the middle
- The Applied Steps pane on the right, showing every transformation you have applied
Applied Steps is the most important part. Every action you take — removing a column, filtering rows, changing a type — is recorded as a step. You can rename steps, delete them, or reorder them. This is what makes Power Query in Excel so powerful compared to manual cleaning.
Common Transformations
Here are the transformations in Power Query in Excel that cover 90% of real-world cleaning:
- Remove Blank Rows
Home > Remove Rows > Remove Blank Rows. This deletes rows where all cells are empty. If your CSV has trailing blank rows, this fixes it in one click. - Remove Duplicates
Select the column(s) you want to check, then Home > Remove Rows > Remove Duplicates. It keeps the first occurrence of each duplicate. This is safer than the built-in Remove Duplicates tool because the source data is not modified. - Change Data Types
Power Query often guesses data types automatically, but it can guess wrong. Click the icon in the column header (ABC, 123, date symbol) to change the type. Make sure dates are dates, numbers are numbers, and text is text. - Trim and Clean Text
Transform > Format > Trim removes extra spaces. Transform > Format > Clean removes non-printable characters. These two fixes solve many lookup failures. - Split Columns
If a column contains “Rahul Sharma” and you want first and last names separate, use Transform > Split Column > By Delimiter. Pick space as the delimiter. Power Query creates two columns. - Merge Columns
The opposite. Select two columns, then Transform > Merge Columns. Choose a separator (space, comma, dash). Useful for combining first and last name into a full name. - Filter Rows
Use the dropdown on any column header to filter. You can filter by text, number, or date. Filters behave like Excel filters but are recorded as steps, so they run automatically every time. - Replace Values
Right-click a column and choose Replace Values. Useful for standardizing entries like “N/A”, “NA”, “Not Available” into one consistent value. - Group By
Transform > Group By lets you aggregate data — sum of sales by region, count of orders per customer, etc. It is like a Pivot Table but baked into the query. - Unpivot Columns
Select columns that should be unpivoted, then Transform > Unpivot Columns. This turns wide data (months as columns) into long data (months as rows). It is essential for Pivot Tables that need one date column.
The Applied Steps Example
Suppose you load a sales CSV. Your steps might look like:
- Source
- Promoted Headers
- Changed Type
- Removed Blank Rows
- Removed Duplicates
- Trimmed Text
- Filtered Rows (Status = “Active”)
- Changed Type (Revenue = Decimal Number)
Each step is visible and editable. If you notice on step 6 that the trim missed something, you can go back to step 6, add another transformation, and everything after recalculates automatically. This is what makes Power Query in Excel so much safer than manual cleaning.
Loading the Result Back into Excel
Once your steps are done, click “Close & Load” in the top-left. Power Query in Excel loads the cleaned data as a table on a new sheet. The original source file is untouched.
From now on, if the source file changes (new rows added, values updated), you just right-click the table and click Refresh. Power Query reruns all steps and updates the table. In a real workflow, this turns a 30-minute monthly cleanup into a 30-second refresh.
Combining Multiple Files
One of the most useful Power Query in Excel features is combining files from a folder. Suppose you get a new CSV every month, all with the same structure. Instead of manually combining them, you can:
Step 1: Data > Get Data > From File > From Folder.
Step 2: Browse to the folder and click Open.
Step 3: Power Query in Excel shows a list of files. Click “Combine & Transform Data”.
Step 4: Power Query automatically combines all files into one table.
Now every time a new file is added to the folder, you refresh, and the combined table includes it. This alone saves hours for anyone who works with monthly reports.
Practical Example: Cleaning a CRM Export
Suppose you download a CRM export with these problems:
- Extra blank rows at the bottom
- Trailing spaces in customer names
- Dates in DD/MM/YYYY and MM/DD/YYYY formats
- Some rows with status “inactive” that should be excluded
- Duplicate customer IDs
In Power Query, the steps would be:
- Load CSV.
- Remove blank rows.
- Trim text columns.
- Change Date column to Date type (Power Query will try to parse).
- Filter Status <> “inactive”.
- Remove duplicates based on Customer ID.
- Close & Load.
Total time: 5 minutes first time, 5 seconds every refresh after. That is the real value of Power Query.
Practice With Your Own Data
Build a small messy table to practise on. In a blank sheet, type these headers in row 1: Name, City, Amount. Then add five rows with messy data on purpose — a name in lowercase, a city with a trailing space, an amount typed as text, one blank row, and one duplicate row.
- Load it into Power Query in Excel. Select the table, go to Data > From Table/Range, and click Transform Data to open the editor.
- Clean it. Remove the blank row, remove the duplicate, trim the City column, change the Name column to proper case, and change the Amount column to a number type.
- Load it back. Click Close & Load and check the new table. Then change one value in the source, right-click the result table, and click Refresh to watch the change flow through.
Now open the Applied Steps pane and read each step from top to bottom. Every click you made is listed there in order. Click any step to see the data at that point. That list is the whole point of Power Query: the cleaning is saved as steps, so next month you only refresh instead of cleaning again. Try renaming the query to something clear, like Practice_Clean, before you close.
Frequently Asked Questions
Does Power Query change my source file?
No. Power Query reads the source and builds a new table. The original file is untouched. This is a key safety advantage.
Can I edit a step in Power Query?
Yes. Click the step in the Applied Steps pane to view its data, and modify the step from the formula bar or by re-applying a transformation. Everything after recalculates automatically.
Does Power Query work on Mac?
Yes, but some features are limited compared to Windows. The core functionality — loading, cleaning, and refreshing — works on both.
Can I use Power Query to combine multiple sheets in the same workbook?
Yes. Use Data > Get Data > From File > From Workbook, then select the sheets you want to combine. Power Query handles the rest.
Does Power Query replace formulas?
No. It complements them. Power Query handles cleaning and combining. Formulas handle in-cell calculations. Use both.
How does Power Query handle errors in the data?
You can filter out error rows or replace errors with a value using the “Replace Errors” option on the right-click menu. This is useful for messy source data.
Keep learning: Excel Dashboard: Best 7-Step Guide Without Add-ins shows how to turn cleaned data into a dashboard, and How to Analyze Sales Data in Excel with Pivot Tables walks through pivot-table analysis.
Final Thoughts
Power Query in Excel is the single biggest upgrade a regular Excel user can make. It turns repetitive cleaning into a one-time setup, keeps source data safe, and handles cases that used to require VBA. If you work with imported data even once a month, learn the basics: load, clean, close and load, refresh. That small skill will save you hours every month and make your spreadsheets feel professional in a way that manual cleaning never does.










