🎓 Zero-to-Hero masterclass

Text Functions

Treat words like data: snip, clean, glue and relabel text with LEFT, TRIM, PROPER, CONCAT, TEXTJOIN, FIND and SUBSTITUTE.

14 functions2 maps8 live drills
🟢 Foundation 🗺️ Visual map 🟡 Deep dive 🔴 Traps & hacks 💻 Sandbox
🟢

The Foundation

Level 1 · the hook & basics

Open any spreadsheet and the cells hold two kinds of thing. Some are numbers you can add up. The rest are words — names, cities, PAN codes, email addresses. In Excel these words are called text (or a text string), and just like numbers, text can be measured, cut, cleaned and glued back together with formulas.

Here is the picture to keep in your head. Text functions are a little craft kit for words.

  • ScissorsLEFT, MID and RIGHT snip characters off the start, middle or end.
  • A rulerLEN measures how many characters there are, and FIND and SEARCH tell you the position of a letter.
  • An eraserTRIM rubs out stray spaces, and SUBSTITUTE rubs out any characters you name and swaps in new ones.
  • Glue — the & sign, CONCAT and TEXTJOIN stick pieces of text together.
  • A label-makerUPPER, LOWER and PROPER reprint your words in CAPITALS, small letters, or Nicely Capitalised.

Why bother? Because real data arrives messy. One person types " ravi kumar " with stray spaces, another shouts RAVI in capitals, a third pastes a PAN as abcde1234f. Text functions let you fix a whole column in one go instead of retyping a thousand rows by hand. That is the everyday magic that turns an afternoon of typing into two seconds.

Golden rule: characters are counted from 1, left to right — and yes, a space is a character too. TRIM before you compare two lists, or invisible spaces will make equal things look different.

Everything below rests on that one idea: a cell of text is just a row of characters at positions 1, 2, 3… and every tool here either measures those positions, cuts at them, cleans them, or glues new ones on.

🗺️

Visual Architecture

the whole system on one screen

Two maps of the same toolkit: first the whole kit at a glance, then a decision path for picking the right tool.

🧠 Text toolkit — a mind mapFour jobs, fourteen tools

Text

Extract

LEFT

MID

RIGHT

LEN

Clean

TRIM

UPPER

LOWER

PROPER

Glue

Ampersand

CONCAT

TEXTJOIN

Find and swap

FIND

SEARCH

SUBSTITUTE

View Mermaid.js source
mindmap
  root((Text))
    Extract
      LEFT
      MID
      RIGHT
      LEN
    Clean
      TRIM
      UPPER
      LOWER
      PROPER
    Glue
      Ampersand
      CONCAT
      TEXTJOIN
    Find and swap
      FIND
      SEARCH
      SUBSTITUTE
🧭 Which text tool do I useFollow the arrows

Yes

Start

End

Middle

No

Extra spaces

Change case

No

Yes

No

Find position

Swap text

What must you do to the text

Pull out part of it

Which side

LEFT

RIGHT

MID

Clean or change case

TRIM

UPPER LOWER PROPER

Join pieces together

Ampersand CONCAT TEXTJOIN

Find or swap characters

FIND or SEARCH

SUBSTITUTE

View Mermaid.js source
flowchart TD
  A[What must you do to the text] --> B{Pull out part of it}
  B -->|Yes| C{Which side}
  C -->|Start| D[LEFT]
  C -->|End| E[RIGHT]
  C -->|Middle| F[MID]
  B -->|No| G{Clean or change case}
  G -->|Extra spaces| H[TRIM]
  G -->|Change case| I[UPPER LOWER PROPER]
  G -->|No| J{Join pieces together}
  J -->|Yes| K[Ampersand CONCAT TEXTJOIN]
  J -->|No| L{Find or swap characters}
  L -->|Find position| M[FIND or SEARCH]
  L -->|Swap text| N[SUBSTITUTE]
🟡

The Deep Dive

Level 2–3 · core mechanics → expert edge

Every text function works on one idea: a cell is a line of characters sitting at positions 1, 2, 3 and onwards. Point at the right positions and you can cut, measure, clean or glue. Here is that ruler for the name RAVI KUMAR.

Every character sits at a numbered position, counted from 1 on the leftR1A2V3I4space5K6U7M8A9R10LEFT snips from position 1 to the rightRIGHT snips from the end back

Now take the toolkit one drawer at a time.

Cut characters — LEFT, RIGHT and MID. These are your scissors.

  • LEFT(text, n) keeps the first n characters. LEFT("RAVI KUMAR",4) gives RAVI.
  • RIGHT(text, n) keeps the last n. RIGHT("560001",3) gives 001, handy for the tail of a pincode.
  • MID(text, start, n) begins at position start and takes n characters. MID("RAVI KUMAR",6,5) gives KUMAR.

Measure — LEN. LEN(text) counts every character, spaces included. LEN("ABCDE1234F") is 10, which is exactly how many characters a PAN should have — a quick validity check.

FunctionWhat it doesExampleResult
LEFTfirst n characters=LEFT("RAVI KUMAR",4)RAVI
RIGHTlast n characters=RIGHT("560001",3)001
MIDn characters from a start point=MID("RAVI KUMAR",6,5)KUMAR
LENhow many characters=LEN("ABCDE1234F")10

Clean and recase — TRIM, UPPER, LOWER, PROPER.

TRIM(text) is the eraser you will reach for most. It strips spaces from the start and end and squeezes any double spaces inside down to one, so " ravi kumar " becomes ravi kumar. It is the number-one real-world fixer, because copied-and-pasted data is riddled with invisible spaces.

The three case tools relabel your words. UPPER shouts in CAPITALS (great for PAN codes), LOWER whispers in small letters (great for email addresses), and PROPER is the label-maker that Capitalises The First Letter Of Every Word — perfect for names and cities.

FunctionWhat it doesExampleResult
TRIMremove extra spaces=TRIM(" ravi kumar ")ravi kumar
UPPERALL CAPITALS=UPPER("ravi")RAVI
LOWERall small letters=LOWER("RAVI")ravi
PROPERCapitalise Each Word=PROPER("ravi kumar")Ravi Kumar
Scissors need a position. LEFT counts from the left, RIGHT from the right, MID from a spot you choose. Remember the space is character 5 in RAVI KUMAR — miscount it and your cut lands in the wrong place.

Glue pieces together — &, CONCAT, CONCATENATE and TEXTJOIN.

The simplest glue is the ampersand. =A2 & " " & B2 sticks the first name, a space, and the last name into one cell. CONCAT does the same as a function: =CONCAT(A2," ",B2). CONCATENATE is its older twin — identical result, longer name, kept for backwards compatibility. Whichever you pick, you must add the space yourself; Excel never guesses it.

When you need to join a whole list — every city in a column, say — reach for TEXTJOIN(delimiter, ignore_empty, range). The first argument is the separator to drop between items, the second is TRUE to skip blank cells, and the third is the range. =TEXTJOIN(", ",TRUE,A2:A4) turns three cells into Aarav, Diya, Kabir with the commas placed for you.

Type the full name in A2, for example Ravi Kumar.
Find the space with FIND(" ",A2). For Ravi Kumar it returns 5, because the space is the fifth character.
Cut the first name with LEFT(A2,FIND(" ",A2)-1) which gives Ravi — you stop one character before the space.
Cut the last name with MID(A2,FIND(" ",A2)+1,20) which gives Kumar — you start one character after the space.
Rebuild it your way, such as Lastname comma initial: CONCAT(MID(A2,FIND(" ",A2)+1,20),", ",LEFT(A2,1)) gives Kumar, R.

Find a position, or swap characters — FIND, SEARCH and SUBSTITUTE.

FIND(what, inside) tells you the position of a character. FIND(" ","RAVI KUMAR") returns 5 because the space is the fifth character. SEARCH does the same job with two differences: it ignores case and it accepts wildcards. So FIND("k","Kumar") fails, while SEARCH("k","Kumar") happily returns 1.

SUBSTITUTE(text, old, new) is find-and-replace inside a single cell. =SUBSTITUTE("A-B-C","-","") deletes every hyphen to give ABC, and =SUBSTITUTE("Mr Rao","Mr","Shri") swaps a title. An optional fourth argument lets you change only the first, second or nth occurrence instead of all of them.

FunctionWhat it doesExampleResult
&glue two pieces="Ravi"&" "&"Kumar"Ravi Kumar
CONCATglue many pieces=CONCAT("Pune","-","411001")Pune-411001
TEXTJOINglue a list with a separator=TEXTJOIN(", ",TRUE,A2:A4)Aarav, Diya, Kabir
FINDposition, case-sensitive=FIND("K","RAVI KUMAR")6
SEARCHposition, ignores case=SEARCH("k","RAVI KUMAR")6
SUBSTITUTEswap one bit of text for another=SUBSTITUTE("A-B-C","-","")ABC

Combine them — the real power. The magic happens when one function feeds another. To pull the first name out of A2, first FIND the space, then LEFT up to just before it: =LEFT(A2,FIND(" ",A2)-1). To build a tidy email from a first and last name: =LOWER(CONCAT(A2,".",B2,"@pdcampus.in")) gives ravi.kumar@pdcampus.in. Read a nested formula from the inside out — the inner function runs first, and its answer becomes an argument for the outer one.

🔴

Expert Traps & Hacks

Level 4 · where 90% slip — and the exam edge

Text looks simple, so it trips up almost everyone. Here are the mistakes to expect and the fixes the pros reach for.

Trap 1 — invisible spaces. A cell that reads Mumbai may really be "Mumbai " with a trailing space, so a lookup or an equals test quietly fails. Wrap both sides in TRIM before you compare or match: =TRIM(A2)=TRIM(B2). TRIM before you compare — always.
Trap 2 — off-by-one counting. FIND returns the position OF the character you searched for, the space included. To grab the last name you must start one after it with FIND(" ",A2)+1; to grab the first name you must stop one before it with FIND(" ",A2)-1. Forget the +1 and you keep a leading space; forget the -1 and you drag the space along.
Trap 3 — forgetting the space when you glue. =A2 & B2 gives RaviKumar, all stuck together. Excel never adds spaces for you, so you must glue one in yourself: =A2 & " " & B2.
Trap 4 — FIND is case-sensitive. FIND("k","Kumar") errors because it wants a small k. If case should not matter, use SEARCH instead. SUBSTITUTE is fussy about case too, so swapping "st" will not touch "ST".
Trap 5 — the answer is text, not a number. LEFT("560001",3) gives "560" as text. It looks like a number but will not always add up or sort correctly. Multiply it by 1, or wrap it in VALUE, when you need a true number.
Pro hack — build an email in one shot. With the first name in A2 and the last in B2: =LOWER(CONCAT(A2,".",B2,"@pdcampus.in")) turns Ravi and Kumar into ravi.kumar@pdcampus.in. LOWER guarantees no stray capitals, CONCAT does the joining, and you just change the domain to suit.
Pro hack — PROPER is not perfect. PROPER capitalises after every non-letter, so it makes "o'brien" into "O'Brien" and cannot fix "mcdonald". For ordinary names it is a great first pass, but eyeball the odd surname and correct it by hand.
💻

Interactive Sandbox — Formula Sandbox

type a real formula — the cell fills and turns green

Eight real cells to fix. Type a formula, press Run, and watch the cell turn green when your text comes out exactly right.

🧮 Formula Sandboxtype it · run it · green when right
0Correct
0Streak
🇬🇧 The complete Excel pathThis module is one of ten. Work through them in order — Grid Basics to Dynamic Arrays — then keep the Function Atlas open as your desk reference. All 10 Excel modules →