Hands-On Lab 5 - Cleaning Data
Hands-On Lab 5 - Cleaning Data
Hands-On Lab 5 - Cleaning Data
html
In this lab, first you will learn how to deal with inaccurate data, how to remove empty rows, and how to remove duplicated data. Next, you will
learn how to change the case of text, how to change date formatting, and how to trim whitespace from data. Finally, you will learn how to use
the Flash Fill feature and functions in Excel to help clean data.
Although you can use the Excel Desktop software if you have access to this version, it is recommended that you use Excel for the web for the
hands-on labs as the lab instructions specifically refer to this version, and there are some small differences in the interface and available
features.
We are using a modified subset of that dataset for the lab, so to follow the lab instructions successfully please use the dataset provided with
the lab, rather than the dataset from the original source.
Objectives
After completing this lab, you will be able to:
Task A: Use the PROPER function to change text from upper case to
proper case
1. Select row 2, then right-click it and choose Insert Rows.
2. In cell A2, type =PROPER(A1) and press Enter.
3. Hover over the bottom-right corner of cell A2, and drag the Fill Handle across to the last column.
If dragging across is too difficult with the mouse, then select the cells in the row 2 using SHIFT+RIGHT ARROW, then press F2 to
put the cursor focus back in cell A2, then hold CTRL while you press Enter.
4. Select row 2, then press CTRL+C.
5. Select row 1, Right-click and choose Paste Options>Values.
6. Select row 2, right-click it and choose Delete Rows.
Task B: Use the UPPER function to change text from proper case to
upper case
1. Select column AG (Generation). Then right-click and choose Insert Columns. In cell AG1, type Generation.
2. In cell AG2, type =UPPER(AH2) and press Enter.
3. Hover over the bottom-right corner of cell AG2 and double-click the Fill Handle.
4. Select column AG, then press CTRL+C.
5. Select column AH, right-click and choose Paste Options>Values.
6. Select column AG, right-click it and choose Delete Columns.
Task C: Use the LOWER function to change text from proper case to
lower case
1. Select column AC (T_Type). Then right-click and choose Insert Columns. In cell AC1, type T_Type.
2. In cell AC2, type =LOWER(AD2) and press Enter.
3. Hover over the bottom-right corner of cell AC2 and double-click the Fill Handle.
4. Select column AC, then press CTRL+C.
5. Select column AD, right-click and choose Paste Options>Values.
6. Select column AC, right-click it and choose Delete Columns.
If you are using the desktop version of Excel, you could use the 'Text to Columns' feature to perform this next task (see the
corresponding topic video for instructions).
If you are using ‘Excel for the web’ (the online version of Excel), the ‘Text to Columns’ feature is not available, but you can achieve the
same results using functions, as shown in the steps below.
Task B: Use LEFT, RIGHT, LEN, and SEARCH functions to clean data:
1. Select column A (Cust_Name), right-click and choose Insert Columns.
2. Select column A again, right-click and choose Insert Columns.
3. In cell A1, type Customer_Firstname and in cell B1, type Customer_Lastname.
4. Click C1, then on the Home tab, click Format Painter, then drag across to A1 and B1.
5. Double-click the divider between columns A and B.
6. In cell A2 type =LEFT(C2, SEARCH(" ",C2,1)) and press Enter.
7. In cell B2 type =RIGHT(C2,LEN(C2)-SEARCH(" ",C2,1)) and press Enter.
8. Double-click the Fill Handle on cell A2.
9. Double-click the Fill Handle on cell B2.
Congratulations! You have completed Lab 5, and you are ready for the next
topic.
Author(s)
Sandip Saha Joy
Other Contributor(s)
Steve Ryan
Changelog
Date Version Changed by Change Description