X
Excel Zero to Hero Interactive Learning Platform
0%
πŸ“ 02_Notes/03_Formulas_and_Functions/05_Text_Manipulation_Functions.md
View Note on GitHub β†— | Open in Obsidian
Module 3

Text Manipulation

intermediate
⏱️ ~8 min read
Practice in Labs β†’

Lesson 3.5: String Cleansing, Text Parsing & Concatenation

🎯Learning Objective

Clean, extract, substitute, search, and assemble text strings using CONCAT, LEFT, RIGHT, MID, LEN, TRIM, SUBSTITUTE, REPLACE, FIND, SEARCH, UPPER, LOWER, PROPER, TEXTJOIN, and TEXTSPLIT.

πŸŽ₯ Video Chapter: Chapter 3 – Excel Formulas & Functions (1:38:56)


1. Core Text Functions Overview

Category Function Syntax Description & Behavioral Rules
Joining CONCAT =CONCAT(text1, [text2], ...) Joins multiple strings or cell ranges without inserting delimiters.
Joining TEXTJOIN =TEXTJOIN(delim, ignore_blank, text1, ...) Joins strings with a specified separator; can automatically skip empty cells.
Extract LEFT =LEFT(text, [num_chars]) Returns specified number of characters from the beginning (left) of a string.
Extract RIGHT =RIGHT(text, [num_chars]) Returns specified number of characters from the end (right) of a string.
Extract MID =MID(text, start_num, num_chars) Returns characters from the middle of a string starting at start_num.
Length LEN =LEN(text) Returns total count of characters, including letters, digits, and all whitespace.
Clean TRIM =TRIM(text) Strips leading/trailing spaces and reduces multiple consecutive spaces to one.
Case UPPER =UPPER(text) Converts all characters to uppercase ("CAIRO").
Case LOWER =LOWER(text) Converts all characters to lowercase ("cairo").
Case PROPER =PROPER(text) Converts string to Title Case (capitalizes first letter of each word).

2. Dynamic Text Parsing: SUBSTITUTE vs REPLACE

A common interview and practical hurdle is choosing between SUBSTITUTE and REPLACE:

DIAGRAM
Rendering architecture diagram...
View Mermaid Syntax
flowchart TD
    Choice{"How do you identify what to replace?"}
    Choice -->|By matching specific text or character| Sub["SUBSTITUTE()"]
    Choice -->|By numerical character position & length| Rep["REPLACE()"]
Dimension SUBSTITUTE REPLACE
Mechanism Matches target text content Targets exact character index/position
Syntax =SUBSTITUTE(text, old_text, new_text, [instance_num]) =REPLACE(old_text, start_num, num_chars, new_text)
Case Sensitivity Case-Sensitive ("A" $\neq$ "a") N/A (operates on index numbers)
Instance Control Can replace all instances or only instance 1, 2, etc. Single fixed position replacement
Best Scenario Replacing phone hyphens, swapping currency symbols Masking credit cards, replacing fixed-width codes

3. Substring Locators: FIND vs SEARCH

Feature FIND SEARCH
Case Sensitivity Case-Sensitive Case-Insensitive
Wildcard Support No (* and ? are treated as literal characters) Yes (* for any string, ? for single character)
Return Value 1-based character position index 1-based character position index
Error When Missing Returns #VALUE! error Returns #VALUE! error
Common Partner Combined inside MID or LEFT for dynamic splitting Combined inside ISNUMBER(SEARCH(...)) for keyword flags

4. Practical Implementation Patterns

Pattern A: Standardized Name Cleaning

EXCEL
=PROPER(TRIM(A2))

Pattern B: Dynamic First Name Extraction

Extracts first name dynamically regardless of length:

EXCEL
=LEFT(A2, SEARCH(" ", A2) - 1)

Pattern C: Safe Delimiter Replacement

Replace the second hyphen in an SKU code:

EXCEL
=SUBSTITUTE(A2, "-", "/", 2)

Related Knowledge

πŸ”— Connected Knowledge & Hands-On Practice

8-Step Learning Loop
🎯 Practice Lab
Excel Tables & Structured References
πŸ“Š Recommended Dataset
Sample Superstore (9,994 rows)
⚑ Key Functions
🧠 Visual Architecture
Explore Module 3 in Mind Map β†’