TGViewer
Data Analytics Data Analytics @sqlspecialist ยท 111K subscribers
Post #3038 2.98K
๐Ÿš€ Data Analyst Roadmap โ€” Part 6

๐Ÿ“Š Excel โ€” Level 5: Text Functions for Data Cleaning & Transformation

As a Data Analyst, you'll rarely receive perfectly clean data.

You may encounter:

" John"

"John "

"JOHN"

"john"

"John Smith"

"John Smith"

You may also have data such as:

EMP-001-IND

Mumbai, India

john.smith@email.com

+91-9876543210

Before analyzing this data, you often need to clean, extract, combine, split, or standardize text.

That's why Excel's text functions are extremely useful.

1๏ธโƒฃ TRIM()

What does it do?

TRIM() removes unnecessary spaces from text.

For example:

" John Smith "

becomes:

"John Smith"

Formula:

=TRIM(A2)

Why is this important?

Suppose you have:

IT

IT

IT

IT

They may look identical, but hidden spaces can cause lookup and filtering problems.

For example:

=XLOOKUP("IT",A2:A100,B2:B100)

may not behave as expected if the underlying values contain unwanted spaces.

Data Analyst use cases:

Use TRIM() for:

โ€ข Customer names

โ€ข Department names

โ€ข Product names

โ€ข Country names

โ€ข Category values

2๏ธโƒฃ CLEAN()

CLEAN() removes many non-printing characters from text.

Formula:

=CLEAN(A2)

This can be useful when data is copied from:

โ€ข Websites

โ€ข External systems

โ€ข Reports

โ€ข PDFs

โ€ข Legacy applications

Sometimes invisible characters are present even though the text looks normal.

TRIM vs CLEAN:

TRIM() โ†’ Removes unnecessary spaces.

CLEAN() โ†’ Removes non-printing characters.

You can combine them:

=TRIM(CLEAN(A2))

This is a very useful basic data-cleaning pattern.

3๏ธโƒฃ UPPER()

Converts text to uppercase.

=UPPER(A2)

Example:

india

becomes:

INDIA

Why use it?

Suppose your dataset contains:

India

india

INDIA

You can standardize them using:

=UPPER(A2)

Now they all become:

INDIA

4๏ธโƒฃ LOWER()

Converts text to lowercase.

=LOWER(A2)

Example:

JOHN.SMITH@EMAIL.COM

becomes:

john.smith@email.com

This is particularly useful for standardizing:

โ€ข Email addresses

โ€ข Usernames

โ€ข IDs

โ€ข Text categories

โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

5๏ธโƒฃ PROPER()

Converts text into proper case.

=PROPER(A2)

Example:

john smith

becomes:

John Smith

And:

mumbai

becomes:

Mumbai

Important:

PROPER() is useful for presentation, but don't automatically use it for every dataset.

Some names, product codes, or abbreviations should remain uppercase.

For example:

IBM

SQL

USA

may become undesirable results if automatically converted to proper case.

6๏ธโƒฃ LEN()

LEN() returns the number of characters in a text string.

=LEN(A2)

Example:

A2 = "John"

Result:

4

Why is this useful?

It can help identify:

โ€ข Invalid IDs

โ€ข Incorrect phone numbers

โ€ข Unexpected text lengths

โ€ข Data-quality issues

For example:



Employee IDs should always contain 6 characters.



You could check:

=IF(LEN(A2)=6,"Valid","Check")

7๏ธโƒฃ LEFT()

LEFT() extracts characters from the beginning of a text string.

Syntax:

=LEFT(text,num_chars)

Example:

EMP-001-IND

To extract the first three characters:

=LEFT(A2,3)

Result:

EMP

8๏ธโƒฃ RIGHT()

RIGHT() extracts characters from the end of a text string.

Example:

EMP-001-IND

Formula:

=RIGHT(A2,3)

Result:

IND

This can be useful for extracting:

โ€ข Country codes

โ€ข File extensions

โ€ข Product suffixes

โ€ข Transaction codes

9๏ธโƒฃ MID()
  • โค 6
More from @sqlspecialist
  1. Oct 7, 2026Alternatively, depending on the Excel version and requirement, I could use functions suchโ€ฆ
  2. Oct 7, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 5 Guys, let's continue our Data Analyst Interviewโ€ฆ
  3. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  4. Oct 7, 2026๐Ÿ”Ÿ What is the difference between UNION and JOIN? Sample Answer: "JOIN combines columns frโ€ฆ
  5. Oct 7, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 4 Guys, let's continue our Data Analyst Interviewโ€ฆ
  6. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’