Data cleansing is an important activity within Excel and one that we find ourselves doing day in day out, sometimes without even knowing it.
So what is data cleansing?
In the words of Oz du Soleil, Excel MVP, it is like “Hercules being sent out to capture the three-headed dog that guards the entrance to hell!”
So you can see that Oz sees that data cleansing is hard work but one that needs to be done in order to succeed in Excel.
We get thrown data at us from external accounting systems, ERPs or downloads from the company server and most of the time it is not imported in an Excel friendly way. This is where you and I come in to clean the data!
You can listen to our podcast episode which was highly entertaining and full of golden nuggets by clicking on below’s image and further down I will show you the My Top Data Cleansing Techniques, which include the ones that Oz uses:
1. Unpivot Data
Power Query is a free add-in created by Microsoft for Excel 2010 (or later) and you can download and install it for Excel 2010 and 2013 here:
In Excel 2016 it comes built in the Ribbon menu under the Data tab and within the Get & Transform group.
Power Query allows you to extract data from any source, clean and transform the data and then load it to another sheet within Excel, Power Pivot or the Power BI Designer canvas.
One of the best features is to Unpivot Columns.
What that does is transforms columns with similar characteristics (e.g. Jan, Feb, March…) and puts them in a unique column or tabular format (e.g. Month), which then allows you to do further analysis using Pivot Tables which was not possible before unpivoting.
Here is how this is done:
2. Find & Replace
The Find & Replace feature or CTRL+H shortcut allows you to amend your data in seconds. Imagine you had thousands of rows of data that was downloaded from an external system with the wrong date. A simple CTRL+H will save you heaps of time! See how below.
3. Find Errors with Go to Special Constants
For example, say you have a column which contains Dates and you want to check that there are no cells which contain Text.
You can easily check this by highlighting that column and pressing CTRL+G to bring up the Go To dialogue box (or by choosing from the menu Home > Find & Select > Go To…)
Then you need to choose Special > Constants and select the constant that you want to find in your column.
In our example you will need to only select the Text box and de-select the other boxes and press OK. This will highlight the cells that contain text and you can begin to format these cells.
4. Find Blank Cells In Excel With A Color
In Excel you can have a data set that comes from an external source which isn’t always formatted to your liking.
One of the most common things you may encounter are blank cells in your Excel data which can hinder your analysis, especially if you are using a Pivot Table to analyze the data.
To find these annoying blank cells in Excel you will need to highlight all your data set (CTRL+*) and bring up the Go To shortcut: CTRL+G > Special > Blanks.
Then you can fill in the blank cells with a color red and filter by that same color to drill down to these blank cells and take some formatting action.
5. Remove Duplicates in an Excel Table
When you have duplicates values within your Excel Table there is a quick and easy way to remove those values.
The duplicate values could be all over your Excel Table and sometimes it takes valuable time trying to locate those duplicates and then deleting them.
Not to worry, Remove Duplicates to the rescue!
STEP 1: Click inside your Excel Table and select Table Tools > Design > Remove Duplicates
STEP 2: This will bring up the Remove Duplicates dialogue box. Select only the Column box that contains the duplicates that you want to remove and press OK
6. Text To Columns: Dates
Whenever you download data from an external ERP system like Oracle, SAP, etc, you can have data that is not formatted the way you and Excel likes.
Sometimes “Date” values are downloaded as “Text”, so you cannot sort in the periodic date format.
No worries! Text to Columns to the rescue!
Below I show you how to convert this “Text” data into “Excel friendly” data. Download the workbook to practice this cool trick!
NB: If the dates are not converting properly after you do the Text to Columns, it may be that your computer’s Region formats need changing.
Go to the Region settings in your Control Panel and make sure that the Short Date is in this format: dd/MM/yyyy
7. Using Formulas To Clean Data
There are several formulas that you can use to clean up dirty, inconsistent and wayward data. Below are some of the best formulas that you can use:
8. Excel Add-Ins
DO YOU WANT TO GET BETTER AT EXCEL?
If so, join over 45,000 professionals who get career boosting, Free Excel lessons delivered on a weekly basis!