Webbo3 Data Analytics · Cohort 2 · Excel Track · Week 2, Virtual 2
Text Cleaning Practice, and Your First Look at Verdant Foods
You finish the TechPlug Cleaning Process on your own, Steps 8 to 10. Then you open the pod project file for the first time and fix two of its four problems.
By the end of this class you can
- Replace a column with its cleaned copy using Paste Special, Values
- Clean Branch, Category and Customer_Type the same way as Staff_Name
- Explain why Step 5 (Unknown) has to come before Step 9 (PROPER and TRIM)
- Check the whole cleaning with the filter lists, as Step 10 says
- Open the Verdant Foods file safely and fix its Category and Date columns
In Live 2 your tutor cleaned Staff_Name while you watched. Today nobody is watching. That is the point: the only way to know you can clean a column is to clean one and prove it worked.
What you do in this class
- Part 1: Steps 8 to 10 of the Cleaning Process tab on your working copy of the TechPlug workbook.
- Part 2: download Verdant Foods, set up the pod workbook, and fix the Category column.
- Part 3: find and fix the dates in the wrong format.
- Then open the Week 2 pod task page for the rest of the cleaning and the Cleaning Log.
Hand in: Your cleaned TechPlug workbook, and the pod workbook with Raw Data and Cleaned Data tabs started.
Part 1: Finishing the TechPlug Cleaning Process
Step 8: Replace the Old Column
Your helper column J holds =PROPER(TRIM(I2)), filled down. A formula column depends on the original: delete column I and J turns into errors. So the clean copy goes back over the original as values, and the helper is deleted:
Step 8 of the Cleaning Process
An ordinary paste copies the formula, which would now point at itself and break. Paste Special, Values copies only the text the formula produced. If you see 0 or an error after pasting, press Ctrl + Z and use Values.
Step 9: Repeat for the Other Columns
The same three moves (insert a helper, =PROPER(TRIM(cell)), paste values back) on Branch, Category and Customer_Type. After Step 8 the columns are back in their places: Branch J, Category E, Customer_Type K.
Unknown passes through untouched, because it was already written properly in Step 5. Do Category the same way with =PROPER(TRIM(E2)).
Why Step 5 Comes Before Step 9
What if someone ran Step 9 on Customer_Type before filling the blanks with Unknown? A formula always returns something, and for a blank cell =PROPER(TRIM(K2)) returns empty text: a value with nothing in it. Ask Excel whether that is blank:
FALSE, even on the rows that look empty. Pasted back as values, that empty text would leave fifteen cells that look blank but are not: a filter on (Blanks) might still find them, but ISBLANK would not, and nothing would warn you. Filling Unknown first means there are no blanks left for PROPER and TRIM to turn into empty text. The order of the Cleaning Process is not decoration.
Step 10: Check Your Work
| Column | Spellings before | Values after | Must be |
|---|---|---|---|
| Staff_Name | 101 | 10 | The 10 names in the Staff Directory |
| Branch | 98 | 10 | The 10 branches in the Staff Directory |
| Category | 15 | 5 | Accessories, Appliances, Laptops, Smartphones, Televisions |
| Customer_Type | 9 | 4 | Corporate, Retail, Unknown, Wholesale |
Open each filter list and compare it with this table, exactly as Step 10 says. Then check the row count one last time: Count on column A says 1,051. Your Sales Data tab now matches TechPlug_Sales_Data_Cleaned.csv, the catch-up file in the downloads. Week 3 starts from this state, so save it.
Picture tidying a cupboard: you lay everything out on the bed (the helper column), check each item, put them back folded (Paste Values), and clear the bed (delete the helper). Four shelves, the same routine on each, then one last look to be sure every shelf is right.
Part 2: Verdant Foods, Opened Safely
Verdant Foods Nigeria: the pod project file
Download everything as one zip file (verdant-foods-pod-dataset.zip)
- VerdantFoods_Pod_Dataset.csv: 470 rows, one sheet, 10 columns, with the four deliberate problems
Why We Open This File Differently
TechPlug was imported with Data > From Text/CSV. Verdant Foods is opened with File > Open instead, and the reason is its Date column. It mixes two formats on purpose: most dates are written 2025-01-31, and ten are written 31/01/2025.
From Text/CSV decides one type for the whole column. On a laptop that reads dates month-first, it cannot read 31/01/2025 (there is no month 31) and turns those ten cells into errors, which load as empty cells: the evidence is gone. File > Open is less strict. It keeps whatever it cannot read as text, so the ten dates stay in the sheet, where you can see them and fix them.
Set up the pod workbook
Two tabs now. Raw Data is never touched again. All the work happens on Cleaned Data. If your pod already has a shared workbook from your tutor, do this in that file instead of a new one.
Fix the Category Column
Verdant sells four categories, but 30 cells spell them differently: wrong case, spaces before or after, or both. You know the fix.
Open the filter list on Category_Clean: four entries, Beverages, Cereals, Condiments and Snacks. Paste Values over column F, delete column K, and write in your notes: Category, 30 cells, wrong case and extra spaces, fixed with TRIM and PROPER.
Part 3: The Dates in the Wrong Format
Step 1: Find Out Which Kind of Laptop You Have
The same file behaves differently on different laptops, so first find out what yours did. ISTEXT is the sibling of ISNUMBER: it answers TRUE when a cell holds text.
Filter Date_Is_Text for TRUE and read the status bar.
| What the status bar says | What it means | What you do |
|---|---|---|
| 10 of 470 records found | Your laptop reads dates month-first. The ten day-first dates stayed as text (the case shown here) | Step 2 |
| 0 of 470 records found | Your laptop reads dates day-first (Nigeria and the UK usually do). Excel already read all ten correctly | Skip to Step 3, and use the Notepad check below to log them |
Step 2: Turn the Text Into Real Dates With Text to Columns
Text to Columns splits text into columns, but its last screen also lets you say how to read a date. We use it on the ten text dates only:
Text to Columns, day first
DMY tells Excel "day, then month, then year", so 31/01/2025 becomes the real date 31 January 2025 on any laptop. Check: Date_Is_Text should now say FALSE on every row. Then sort by Transaction_ID, A to Z, to put the rows back in order, and delete the helper column.
Or: Do It With a Formula
If you prefer formulas, the same fix uses the text functions from this week. In 31/01/2025 the day is the first 2 characters, the month is 2 characters starting at position 4, and the year is the last 4. DATE(year, month, day) builds a real date from those three pieces, and IF only does it to the text cells:
Then Paste Values over column B and delete column K. Both routes give the same ten real dates.
Step 3: One Format for the Whole Column
Every date shown the same way
If Your Laptop Already Read Them: the Notepad Check
On a day-first laptop all the dates are real already, so you cannot see which ten were written differently, but the Cleaning Log still needs them. Open the CSV itself in Notepad (right-click the file, Open with, Notepad), press Ctrl + F and search for /2025. Every other date uses hyphens, so each match is one of the ten.
Note the Transaction_ID of each match for your log. There are exactly 10.
Retyping 31/01/2025 as 2025-01-31 in the cell works for one date, but by the tenth you will have typed one wrongly, and nothing will tell you. Text to Columns and the formula do all ten the same way, and you can check them with ISTEXT.
Picture two visitors at a gate, one with an ID card in the local format and one in a foreign format. A strict guard turns the second away and loses his name (From Text/CSV). A careful guard writes the name down as given and sorts it out later (File > Open). Text to Columns is the clerk who reads the foreign card properly.
Checkpoint
Q1. Why does the Cleaning Process fill Unknown (Step 5) before running PROPER and TRIM (Step 9)?
On a blank cell the formula returns empty text, not a blank. Pasted as a value, the cell looks empty but ISBLANK says FALSE. With Unknown filled first, there are no blanks to turn into empty text.
Q2. Why is Verdant Foods opened with File > Open and not From Text/CSV?
From Text/CSV forces one type on the Date column and can turn the day-first dates into errors on a month-first laptop, losing them. File > Open keeps them as text so they can be fixed.
Q3. What does DMY mean in Text to Columns?
Day, Month, Year: the order the date is written in.
Q4. Your ISTEXT filter finds 0 rows. Have you done something wrong?
No. Your laptop reads day-first dates and already converted them. Format the column as yyyy-mm-dd and use the Notepad check to log the ten.
Tick Before You Move On
- ☐ Staff_Name, Branch, Category and Customer_Type are clean, pasted back as values, helpers deleted
- ☐ Each filter list shows exactly the values Step 10 expects
- ☐ The pod workbook has a Raw Data tab, never edited, and a Cleaned Data tab
- ☐ Category in Cleaned Data has four values, and I noted the 30 fixes
- ☐ Every date in Cleaned Data is a real date shown as yyyy-mm-dd
- ☐ I know the Transaction_IDs of the 10 day-first dates
Quick Recap
Clean in a helper column, check it, Paste Special Values, delete the helper. Fill blanks with a label before cleaning text, or the formula turns them into empty text. Open Verdant Foods with File > Open, so dates it cannot read stay visible as text. ISTEXT shows which dates are text; Text to Columns with DMY or a DATE formula turns them into dates. Format the whole Date column as yyyy-mm-dd so every date looks the same.
Next: Pod Task Week 2. The full cleaning brief for Verdant Foods: the 15 duplicates, the 20 blank quantities, the Quantity_Flag column, and the Cleaning Log.