By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: These simple Power Query commands save me hours of data cleanup in Excel
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > These simple Power Query commands save me hours of data cleanup in Excel
Computing

These simple Power Query commands save me hours of data cleanup in Excel

News Room
Last updated: 2025/09/10 at 4:22 PM
News Room Published 10 September 2025
Share
SHARE

Power Query is a game-changer in terms of the amount of time I save, ensuring imported data is ready for analysis in Excel. If you’re new to this tool, it’s helpful to know a few commands that can take your data transformation skills to the next level. Even if you’ve never heard of Power Query, it’s still helpful to look at these examples to see if you’ll be motivated to learn how to use Power Query.

Cleaning data in Excel, especially for multiple workbooks, is one of the most annoying tasks any Excel user has to deal with. But with Power Query, that task can even become somewhat enjoyable.f

Split cells by delimiters

Easily split data into columns

A common problem you’ll run into when cleaning an Excel sheet is when data that should be split into two columns is combined into one. Take a look at the screenshot below, where the Order ID column also has the customer name.

We are going to split this column in Power Query using a delimiter, a character or symbol (like a comma, space, or hyphen) that separates data within a cell. The delimiter is the hyphen or dash (-) separating the order ID from the customer name in the example above.

Let’s assume you have this sheet saved somewhere on your computer. To import it, select the Data tab and click Get Data -> From File -> From Excel Workbook in the Get & Transform Data command group in the ribbon.

From there, navigate to where the file is, select it, and click Import. Under Display Options on the left, select the sheet with the data and click Transform Data. Keep in mind that this is just one way to import data into the editor — the options will be different depending on where you’re getting the data from.

In the Power Query editor, highlight the column (Order ID in our example) and click Split Column -> By Delimiter in the Transform command group of the Home tab. In the Select or enter delimiter dropdown, select Custom. Directly below it, enter the delimiter you want to use and click OK.

Once the column is split, rename the new columns to something that makes sense. I renamed them to Order ID and Customer Name, respectively. Afterward, click Close & Load in the Close command group.

Subtract dates

Get precise date differences

Continuing with the example table above, we can also perform various calculations on the columns in the Power Query editor. I usually take this opportunity to add extra columns for certain calculations. The most common one I do is find the difference between dates.

Here, I want to find how many days the orders were delivered in, so I am going to subtract the order date from the delivery date. To do that, select the Delivery Date column, press Ctrl, and then select the Order Date (mind the order of selection). Next, select the Add Column tab, and click Date -> Subtract Days in the From Date & Time command group of the ribbon.

Subtracting dates in Power Query

The new column will have a generic name like Subtraction. You can double-click it and rename it to something more meaningful. From there, you can close and load the sheet into Excel for your data analysis.

The 'Delivery Dates' column highlighted in Power Query

Filter for errors

Ensure you’re only seeing the affected rows

Power Query doesn’t have an easy way to filter so that you only show rows with errors. These can be a headache if they’re in a file with hundreds of rows or more.

Suppose you know that the Order Date column has errors, and you want to manually resolve them before loading the data in Excel. You can create a filter to only show the affected rows.

Select the Add Column tab and click Custom Column in the General command group of the ribbon. In the Custom column formula text area, enter the following formula and click OK:

        try [Order Date]
    
Creating a custom column to filter for errors in Power Query

Power Query will add a new column called Custom, and the rows will have either a TRUE value if they have errors or FALSE if they don’t. Now, do the following:

  1. Click the arrow icon on the left of the Custom column
  2. Uncheck everything except for Has Error.
  3. Click OK.
  4. Click the arrow icon next to the Custom column again.
  5. Uncheck False.
  6. Click OK.

You will now only see the rows with errors for you to inspect. If the affected rows are not important, the fastest way to deal with them is just to right-click the column and select Remove Errors in the menu. This will delete the rows, so use it carefully.

Removing errors in Power Query

If they’re important, right-click the column and select Replace Errors. If they all need to contain the same value, enter it in the text box and click OK. If not, and you would still like to keep them but eliminate the errors, assign a value like null so the errors are resolved.

You can also go back to the source, correct the errors, and re-import the data afterward.

Afterward, delete the steps for creating the filter in the Applied Steps section of the Query Settings panel on the right. For me, the steps were Added Custom1, Expanded Custom1, and Filtered Rows1. Just click the X icon next to them and click Delete in the pop-up.

Deleting steps in Power Query

Unpivot your data

Aid data analysis

Pivoted data is that which is structured in a wide format, with values spread across multiple columns. This can make data analysis difficult when using something like a pivot table in Excel.

Take a look at the screenshot of the table below that shows sales data across three states. Since months are a category, they should really be in rows instead of columns to aid data analysis.

A pivoted table in Excel

To fix this, we need to unpivot the data, meaning it needs to be reshaped into a tall format. Essentially, the states, months, and sales need to be in separate rows.

An unpivoted table in Excel

Doing this manually will involve a lot of copying and pasting, manually aligning values, and ensuring there are no errors. But Power Query can make it easier.

To do that, select the Data tab, highlight the table, and click From Table/Range in the Get & Transform Data command group of the ribbon. In the Power Query editor, select the columns you want to unpivot by holding Ctrl and clicking on them (e.g., January, February, and March). Right-click them and select Unpivot Columns in the menu.

Unpivoting columns in Excel

Your data is now unpivoted and ready for further data analysis. Be sure to rename the Attribute and Value headers to something more descriptive. This would be Months and Sales in our case.

Unpivoted data in Power Query

A simple query goes a long way

It’s not an exaggeration to say that Power Query will make you look forward to cleaning Excel data. This is especially true since you can create an automated process to clean multiple sheets in the same way. And, as you can see, you can do a lot with a few simple commands.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article HDMI is advancing too fast for me to care
Next Article How to use the controversial T-Life app to get your new iPhone via T-Mobile
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Epstein ‘birthday book’ includes apparent letter from former Microsoft CTO Nathan Myhrvold
Computing
‘War Is Here’: The Far-Right Responds to Charlie Kirk Shooting With Calls for Violence
Gadget
Visit Jupiter and control space and time with visionOS 26
News
Visit Jupiter and control space and time with visionOS 26
News

You Might also Like

Computing

Epstein ‘birthday book’ includes apparent letter from former Microsoft CTO Nathan Myhrvold

4 Min Read
Computing

Chinese AI startup Baichuan shifts focus to core business, shuts B2B financial services unit  · TechNode

1 Min Read
Computing

I can’t use my Google TV without this app

6 Min Read
Computing

Kikimora Announces Launch of Kikimora Agent: Accessible AI-Powered Cybersecurity Platform For SME | HackerNoon

4 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?