Welcome to the first lesson of your course! We're kicking things off by building a foundational skill for any data analyst: cleaning and preparing data. Your goal is to build a strong data analyst resume, and proficiency in data cleaning is a non-negotiable item that recruiters look for. From your experience with exploratory data analysis in Tableau and Power BI, you've likely encountered datasets that were messy or inconsistent. This module will equip you with the essential Excel techniques to handle such data efficiently.
In this lesson, you will learn how to clean and standardize raw data using some of Excel's most powerful text functions. Specifically, we'll cover TRIM, PROPER, LEFT, RIGHT, MID, and TEXT. Mastering these will enable you to transform messy, inconsistent text into a clean, standardized format, which is the crucial first step before any meaningful analysis can begin.
The Importance of Clean Data
Before we dive into the functions themselves, let's establish why this process is so critical. Inconsistent data, even with minor errors, can lead to flawed analysis and incorrect conclusions. A simple typo or an extra space can cause Excel to treat identical items as distinct categories, skewing your summaries, charts, and calculations.
To see a practical example of how a small mistake can compromise your analysis, let's start with a short video.
Data Cleaning in Excel - Text Functions and Power Query in Excel!
This video from the Simon Sez IT channel, "Data Cleaning in Excel," begins by explaining why data cleaning is a vital but often overlooked part of data analysis.
Watch the segment from the beginning of the example. The presenter demonstrates how a single spelling mistake in a list of stores causes a filter to incorrectly identify three stores instead of two. This perfectly illustrates the problem we're about to solve.
This simple demonstration highlights how a clean dataset is the bedrock of reliable analysis. Now, let's learn the tools to build that foundation.
Tidying Text: TRIM and PROPER
Two of the most common issues in text data are unwanted spaces and inconsistent capitalization.
- Extra Spaces: Data imported from other systems often contains leading spaces (before the text), trailing spaces (after the text), or multiple spaces between words. These are often invisible but can prevent proper sorting, filtering, and matching.
- Inconsistent Case: You might have entries like "canada", "Canada", and "CANADA" all in the same column. For analysis, these should be treated as a single category.
The functions TRIM and PROPER are your primary tools for fixing these issues.
TRIM(text)removes all extra spaces from a text string.PROPER(text)converts a text string to "Proper Case," where the first letter of each word is capitalized and the rest are lowercase.
While you can use these functions separately, a data analyst's workflow often involves combining them for maximum efficiency. The following video demonstrates a best-practice technique for cleaning a column of data using a "helper column."
Data Cleaning in Excel - Text Functions and Power Query in Excel!
This segment of the "Data Cleaning in Excel" video provides a step-by-step walkthrough of cleaning a column with spacing and capitalization problems.
Please watch the section from this timestamp. Pay close attention to the workflow: Inserting a temporary "helper column" to build the cleaning formula. Nesting the functions as =PROPER(TRIM(B2)) to solve both problems at once. Using "Copy" and "Paste Values" to replace the original messy data with the clean version, a crucial step to finalize the process.
This "helper column -> paste values" method is a fundamental pattern in Excel-based data cleaning. The image below shows the clean result of a similar operation, where messy first and last names are combined and standardized.

This screenshot shows the result of combining TRIM, PROPER, and CONCATENATE to clean and merge first and last names into a single, standardized column.
Extracting Information: LEFT, RIGHT, and MID
Sometimes, the data you need is a substring embedded within a larger text field. For instance, you might need to extract a three-letter airport code from a longer description, or pull a year from a date stored as text. The LEFT, RIGHT, and MID functions are designed for this kind of extraction.
LEFT(text, [num_chars]): Extracts a specified number of characters from the beginning (left side) of a text string.RIGHT(text, [num_chars]): Extracts a specified number of characters from the end (right side) of a text string.MID(text, start_num, num_chars): Extracts a specific number of characters from the middle of a text string, starting at a position you define.
The following video from TutorialsPoint provides a very clear and concise demonstration of each function.
In this video "MS Excel - Text Functions," the presenter explains the syntax and usage of LEFT, RIGHT, and MID.
Watch the segment from this part of the video. It clearly demonstrates how to use each of the three functions to pull out different parts of a text string.
As a quick reference, the guide below also provides a simple summary of these functions.
Excel Formulas for Data Cleaning: Essential Functions Guide | RowTidy Blog
This guide from the RowTidy Blog offers a cheat sheet of essential data cleaning formulas.
Please review the section on Text Extraction. This gives you a concise syntax reminder for the functions you just saw in the video.
These extraction functions are most powerful when your data has a consistent structure (e.g., all product codes start with a 3-letter prefix). For more complex, variable-length data, they are often nested with functions like FIND and SEARCH, which allow you to locate characters like a hyphen or a space to make your extractions dynamic.
Formatting with the TEXT Function
Our final function, TEXT, is used for standardizing the appearance of numbers and dates by converting them into a specific text format. This is incredibly useful when you need to embed a formatted value within another text string or when you need to enforce a consistent format for reporting (e.g., ensuring all dates are MM-DD-YYYY).
The syntax is TEXT(value, format_text), where value is the number or date you want to format, and format_text is a special code that defines the output style.

This image illustrates various applications of the TEXT function, converting numerical values into formatted text for dates, phone numbers, percentages, and more.
The image above provides a great overview of what TEXT can do. Let's break down a few key examples from the image:
- Date Format:
=TEXT(B5, "mm-dd-yyyy")takes a date value in cell B5 (Excel stores dates as numbers, like 44426) and converts it into the text string "08-18-2021". - Add Leading Zeros:
=TEXT(B6, "00000")takes the number 45 and formats it as the text "00045". This is useful for standardizing IDs or codes that must have a fixed length. - Telephone Number:
=TEXT(B7, "(###)-###-####")transforms a 10-digit number into a standard, readable phone number format. - Decimal to Percentage:
=TEXT(B9, "0.00%")converts the decimal 0.56 into the text "56.00%".
The TEXT function gives you precise control over how numerical data is presented as text, ensuring consistency across your reports and analyses.
Hands-On Practice
You have a strong preference for hands-on learning, and the best way to internalize these functions is to use them. The following resource contains a downloadable Excel file with examples that cover all the functions from this lesson.
This article from Excelx.com, which details several text functions, also provides a link to a practice file.
Scroll to the bottom of the article and find the section Download Excel Practice File. Click the link to download the file and experiment with the formulas we've discussed.
Conclusion
In this lesson, we took the first critical step in the data analysis workflow: cleaning and standardizing data. You learned how to use a suite of powerful text functions to bring order and consistency to messy datasets.
Here are the key takeaways:
- Data cleaning is essential: Small inconsistencies in data can lead to large errors in analysis.
TRIMandPROPERare your go-to functions for fixing extra spaces and inconsistent capitalization. The "helper column -> paste values" workflow is a highly effective method for applying these.LEFT,RIGHT, andMIDallow you to extract specific pieces of information from within larger text strings.TEXTgives you precise control over converting numbers and dates into standardized text formats for reporting and labeling.
In our next lesson, we will build directly on this foundation. We will explore the SUMIFS and COUNTIFS functions, which allow you to perform calculations based on multiple criteria. You will see immediately why our work today was so important—those functions can only return accurate results when the data they are analyzing is clean and standardized.