1 Understanding Text Data in Excel
Excel stores names, addresses, product codes, invoice references, phone numbers and descriptions as text. Even a number may
behave as text when it contains leading zeroes, symbols or imported formatting. Text functions help convert these records into
consistent information that can be searched, matched, grouped and reported accurately.
Definition: A text string is a sequence of letters, numbers, spaces or symbols treated as written information rather than a mathematical value.
Text, Numbers and Leading Zeroes
A product code such as 00125 may lose its leading zeroes when stored as a number. If the value is an identifier
rather than a quantity, store it as text or apply an appropriate custom number format. Do not perform arithmetic on codes merely
because they contain digits.
Professional Tip: Decide whether a field is a measurement or an identifier. Amount, quantity and percentage fields are numeric; phone numbers, PIN codes, GST references and employee IDs are generally identifiers.
Practical Experiment 1: Audit Text Fields
Create a small dataset containing names, mobile numbers, emails, codes and addresses.
Step 1: ObserveIdentify fields with extra spaces, unusual capitalisation, symbols or mixed formats.
Step 2: ClassifyMark each field as numeric measurement, date, identifier or descriptive text.
Step 3: PlanWrite the function or cleaning action required for every inconsistent field.
Learning Output: You will learn to diagnose text problems before selecting formulas.
3 Cleaning Text with LEN, TRIM and CLEAN
Data copied from websites, PDF files, external software or online forms often contains extra spaces and hidden characters.
These may not be visible, but they can cause lookup failures, duplicate-looking records and incorrect comparisons.
Before Cleaning PRIYA DESHMUKH
Length may be greater than expected due to extra spaces.
After TRIMPRIYA DESHMUKH
Leading, trailing and repeated spaces are removed.
Important: TRIM removes the standard space character. Some web data contains non-breaking spaces; SUBSTITUTE may be required to replace CHAR(160) before applying TRIM.
Practical Experiment 3: Repair Imported Customer Names
Paste deliberately inconsistent customer names into a worksheet.
Step 1: MeasureUse LEN to compare character counts before cleaning.
Step 2: CleanApply TRIM(CLEAN(A2)) and fill the formula down.
Step 3: ValidateRecalculate LEN and check whether apparent duplicates now match correctly.
Learning Output: You will see how invisible characters influence reporting accuracy.
4 Standardizing Capitalisation with UPPER, LOWER and PROPER
Consistent text case improves the professional appearance of reports and prevents manual editing. UPPER converts text to capital
letters, LOWER converts text to small letters, and PROPER capitalises the first letter of each word.
Use judgement: PROPER may change abbreviations or special names incorrectly. For example, “AICPE INDIA” becomes “Aicpe India.” Review outputs that contain acronyms, initials or brand-specific capitalisation.
Practical Experiment 4: Standardize a Contact Database
Create separate columns for customer name, email, city and customer code.
Step 1: Apply CaseUse PROPER for names and cities, LOWER for emails and UPPER for codes.
Step 2: Review ExceptionsIdentify initials, acronyms or names that require manual review.
Step 3: Finalize ValuesCopy the cleaned formulas and paste them as values into a final master sheet.
Learning Output: You will build a consistent and presentable database without editing each cell manually.
5 Locating and Replacing Text with FIND, SEARCH and SUBSTITUTE
FIND and SEARCH return the position of one text item inside another. FIND is case-sensitive, while SEARCH is not. SUBSTITUTE
replaces matching text and can also replace a specific occurrence when the same item appears more than once.
Using FIND with MID
Position functions become more powerful when combined with extraction functions. In a value such as NGP-SALES-0248, FIND can
identify the first and second hyphens, allowing MID to return the department even when its length changes.
Dynamic pattern: Use the position of separators instead of assuming that every department name contains the same number of characters.
Practical Experiment 5: Find the Email Domain
Use email addresses of different lengths such as admin@company.in and support@business.org.
Step 1: Locate @Use FIND("@",A2) to identify the separator position.
Step 2: Calculate LengthUse LEN to calculate the number of characters after the @ symbol.
Step 3: Extract DomainCombine RIGHT, LEN and FIND, then compare the result with TEXTAFTER.
Learning Output: You will build variable-length extraction formulas using character positions.
6 Combining Text with Ampersand, CONCAT and TEXTJOIN
Combining fields is useful for full names, addresses, product descriptions, message templates and unique identifiers. The ampersand
operator joins individual items, CONCAT joins a range or several arguments, and TEXTJOIN adds a chosen delimiter while combining values.
Creating a Professional Customer ID
A formula such as =UPPER(LEFT(A2,3)&"-"&LEFT(B2,3)&"-"&TEXT(C2,"0000")) can combine city, customer name and a
serial number into a standardized identifier. The TEXT function controls the display of leading zeroes in the serial portion.
Professional Tip: Use TEXTJOIN with the ignore-empty argument set to TRUE when some address components may be blank. This prevents repeated commas or unnecessary spaces.
Practical Experiment 6: Build Address Labels
Use separate columns for Address Line, Area, City, State and PIN Code.
Step 1: CombineUse TEXTJOIN with comma and space as the delimiter.
Step 2: Ignore BlanksLeave one optional field empty and confirm that no duplicate comma appears.
Step 3: FormatUse PROPER or UPPER selectively to create a professional mailing label.
Learning Output: You will create flexible combined outputs that remain clean when fields are missing.
7 Modern Extraction with TEXTBEFORE and TEXTAFTER
In current versions of Excel, TEXTBEFORE and TEXTAFTER provide simpler separator-based extraction. Instead of calculating character
positions manually, you specify the delimiter and optionally choose which occurrence should be used.
Compatibility note: TEXTBEFORE and TEXTAFTER may not be available in older Excel versions. When workbook compatibility is important, maintain an alternative using LEFT, RIGHT, MID, LEN and FIND.
Practical Experiment 7: Compare Old and Modern Formulas
Extract the domain from an email and the serial number from an invoice reference using two methods.
Step 1: TraditionalBuild the result with RIGHT, LEN and FIND.
Step 2: ModernCreate the same result using TEXTAFTER.
Step 3: EvaluateCompare readability, compatibility and ease of maintenance.
Learning Output: You will select formulas based on both simplicity and the Excel version used by the organization.
8 Building Reliable Text Transformation Formulas
Real-world formulas often combine several text functions. A customer name may need CLEAN, TRIM and PROPER. A code may require
TEXTAFTER, UPPER and SUBSTITUTE. Build formulas in small tested stages before combining them into a final expression.
1Inspect
Identify separators, inconsistent spaces, text case and variable lengths.
2Test Parts
Verify each extraction or cleaning function in a helper column.
3Combine
Nest only the functions required to produce the final output.
4Validate
Test unusual records, blanks, missing delimiters and older Excel compatibility.
Practical Experiment 8: Create a Data-Cleaning Pipeline
Use a raw customer export containing inconsistent names, codes, emails and addresses.
Step 1: Helper ColumnsCreate separate columns for clean name, email domain, customer code and complete address.
Step 2: ValidateCheck blank records, missing separators and unexpected character lengths.
Step 3: Final MasterCopy reviewed outputs and paste values into a protected master-data sheet.
Learning Output: You will transform raw information through a repeatable, auditable workflow.