Ravindra BagaleCourses & study guides मराठी Track your progress

5. Data Cleaning A–Z

5.4 Inconsistent Case

Before

Customer Product
sHRADDHA bAGALE AMUL BUTTER 100 G
ruhi bagale gokul cow milk 500 ml
ZOYA chitale bhakarwadi 250 g

About this data: Teaching sample for a fictional shop “HomeNest Supplies”. Figures and names (e.g. Neha Shah) are made up for this lesson on inconsistent case.

After

Customer Product
Shraddha Bagale Amul Butter 100 g
Ruhi Bagale Gokul Cow Milk 500 ml
Zoya Chitale Bhakarwadi 250 g

About this data: Demo table only — not real customer or company data. Built to practise inconsistent case.

Steps in Excel

  1. Names: =PROPER(TRIM(A2)).
  2. Codes that must be capitals (Store ID, PAN-style codes): =UPPER(TRIM(A2)).
  3. E-mails: =LOWER(TRIM(A2)) (5.11).
  4. PROPER also capitalises units ("500 Ml", "100 G"). Fix them with SUBSTITUTE: =SUBSTITUTE(SUBSTITUTE(PROPER(TRIM(B2))," Ml"," ml")," G"," g"), or use Flash Fill on a few examples.

Ravindra Bagale's Tip

Excel lookups and COUNTIF are case-insensitive, so many students ignore case – but in a report "PUNE" and "Pune" look different, and in Power Query/Power BI they can be treated as different. Standardise the case once. After PROPER, look over units and exceptions like "McD" once.

Practice task

Standardise 15 customer names to proper case and 15 store IDs to upper case. Fix units like "Ml" and "Kg" after PROPER.

Loading practice tasks...

  1. Proper case name (Easy): Show B2 with each word starting with a capital.
  2. Code in capitals (Easy): Show A2 in capitals.
  3. Small letters (Easy): Show C2 in small letters.
  4. Brand in proper case (Easy): Show C7 in proper case.
  5. Trim and proper (Medium): Clean B3 (spaces and case).
  6. Trim and upper (Medium): Clean A5 into capitals.
  7. Clean product name (Medium): Clean B5 (spaces and case).
  8. Size in small letters (Medium): Show D3 in small letters.
  9. Fix a unit after PROPER (Hard): Make D3 read "200 g" using PROPER and SUBSTITUTE.
  10. Shelf label (Hard): Make "Lindt Dark Chocolate" from C3 and B3.
  11. Fix ml (Hard): Make D5 read "500 ml".

Quick revision cards

Three standalone cards. Each one explains the idea with its own example. Scan the QR to open this lesson.

Revision card 1: What is Inconsistent Case?
Card 1: What is Inconsistent Case? · Download PNG
Revision card 2: Tiny example — Inconsistent Case
Card 2: Tiny example — Inconsistent Case · Download PNG
Revision card 3: Checklist — Inconsistent Case
Card 3: Checklist — Inconsistent Case · Download PNG