Excel Practice Test

โ–ถ

You have a column packed with order codes like "INV-2026-04481-CA" and a manager who wants the year separated, the invoice number isolated, and the state code dropped into its own column. This is where Excel's text extraction tools earn their keep. The good news? You don't need macros, add-ins, or copy-paste yoga. Excel ships with a tight set of functions โ€” LEFT, RIGHT, MID, FIND, SEARCH, LEN, TEXTSPLIT, TEXTBEFORE, TEXTAFTER โ€” plus Flash Fill and Power Query for messier jobs.

This guide walks through every method that matters. We start with the classic three (LEFT, RIGHT, MID), then layer in FIND and SEARCH so your formulas adapt to inconsistent strings. After that, we cover the newer dynamic-array functions introduced with Microsoft 365 โ€” TEXTSPLIT, TEXTBEFORE, TEXTAFTER โ€” which replace nested formulas you used to dread. We finish with Flash Fill, Power Query, and a troubleshooting section for the moments when "it works on row 3 but not row 47."

The Three Pillars: LEFT, RIGHT, and MID

Every Excel user picks up these three early, but few learn to use them well. LEFT pulls characters from the start. RIGHT pulls from the end. MID pulls from any position you name. The trick is knowing when to combine them with FIND, SEARCH, or LEN so the formulas survive real-world data.

Syntax is simple. =LEFT(text, num_chars) returns the first n characters of a string. =RIGHT(text, num_chars) returns the last n. =MID(text, start_num, num_chars) grabs a slice starting at start_num. If you skip num_chars, LEFT and RIGHT default to one character. MID requires all three arguments.

Quick example. Cell A2 holds "INV-2026-04481-CA". You want just "INV". The formula =LEFT(A2,3) returns "INV" because you grabbed the first three characters. You want "CA" at the end. =RIGHT(A2,2) gives you "CA". You want "2026"? Use =MID(A2,5,4) โ€” start at character 5, take 4 characters. Done.

This works beautifully when every cell has the same structure. The moment cell A47 reads "INVOICE-2026-04481-CA" instead, your MID formula returns "OICE" and your manager raises an eyebrow. Hard-coded positions are brittle. That's why you almost always pair LEFT, RIGHT, and MID with FIND or SEARCH โ€” so the position adapts to whatever delimiter you actually use.

A common beginner trap: forgetting that Excel counts from one, not zero. So =MID(A2,1,3) starts at the very first character, not the second. If your background is in a programming language, this can trip you up the first dozen times. Keep a sticky note: Excel is 1-indexed.

Also, if you ask for more characters than exist, Excel doesn't error โ€” it just returns whatever is available. That makes formulas like =RIGHT(A2, 200) safe even when A2 is short. You'll exploit this trick in domain extraction below.

One more practical note before we move on. LEFT, RIGHT, and MID all return text โ€” even when the characters you extract look like a number. If you plan to do arithmetic on the result, wrap it in VALUE() or multiply by 1. Otherwise SUM will return zero and sorting will treat "10" as smaller than "9". This single oversight is responsible for more "why is my pivot wrong" tickets than any other text-function mistake.

Excel Text Extraction by the Numbers

6
Core text functions you'll use weekly
1
FIND/SEARCH starting index (Excel is 1-based)
Ctrl+E
Flash Fill shortcut on Windows
32,767
Maximum characters Excel handles in one cell

FIND and SEARCH: Finding the Anchor

FIND and SEARCH locate the position of one string inside another. Both return a number โ€” the character position where the match starts. FIND is case-sensitive and does not accept wildcards. SEARCH is case-insensitive and accepts ? and * wildcards. That's the only meaningful difference. Pick FIND when case matters; pick SEARCH when it doesn't.

Syntax: =FIND(find_text, within_text, [start_num]). If the text isn't found, both functions return #VALUE!. That error is useful โ€” you can wrap it in IFERROR to handle missing delimiters. We'll cover that in the troubleshooting section.

Here's where it gets practical. You have email addresses in column A and you need just the domain (everything after the "@"). The "@" sits at a different position in every cell, so hard-coding won't work. Use FIND to locate the "@", then pass that position to MID or RIGHT.

Formula: =MID(A2, FIND("@",A2)+1, LEN(A2)). Translate it line by line. FIND returns the position of "@" โ€” say 14 for "claire.adams@gmail.com". Add 1 to skip the "@" itself. MID then starts at character 15 and grabs up to LEN(A2) characters (anything remaining). Result: "gmail.com". Drag the formula down. Even if some emails have different lengths, the FIND adjusts.

Need everything before the "@" (the user portion)? =LEFT(A2, FIND("@",A2)-1). The minus one excludes the "@" character itself. These two formulas alone solve roughly half the text-splitting requests you'll get at work.

Combining Functions for Middle Sections

Extracting a chunk between two delimiters is the classic interview question. Suppose A2 holds "INV-2026-04481-CA" and you want "04481" โ€” the middle section between the second and third hyphens. You need to find two positions: where the second hyphen sits, and where the third hyphen sits. Then MID grabs everything in between.

Use the optional third argument of FIND to start searching after an earlier match. =FIND("-", A2, FIND("-",A2)+1) returns the position of the second hyphen. Then nest it again to get the third. The full formula gets long but follows a predictable pattern.

Full version: =MID(A2, FIND("-",A2,FIND("-",A2)+1)+1, FIND("-",A2,FIND("-",A2,FIND("-",A2)+1)+1) - FIND("-",A2,FIND("-",A2)+1) - 1). That works, but it's a mouthful. If you're on Microsoft 365, the newer TEXTBEFORE and TEXTAFTER functions reduce this to a one-liner. Let's look at those next.

FIND vs SEARCH at a Glance

FIND is case-sensitive and rejects wildcards. SEARCH is case-insensitive and accepts ? and *. Both return #VALUE! when the substring is missing โ€” wrap with IFERROR to keep your sheet clean.

Pick FIND when you need exact case matching (rare). Pick SEARCH everywhere else. The two cost the same to run, so default to SEARCH unless case truly matters for your data.

Three Function Tiers โ€” Pick Your Era

๐Ÿ”ด Classic (Excel 2010+)

LEFT, RIGHT, MID, FIND, SEARCH, LEN, SUBSTITUTE. Universal compatibility. Use these when you share files with users on older Excel versions or Excel for the web in restricted modes.

๐ŸŸ  Modern (Microsoft 365)

TEXTBEFORE, TEXTAFTER, TEXTSPLIT, TEXTJOIN. Dynamic arrays that replace nested formulas with single lines. Cleaner, faster to write, easier to audit six months later.

๐ŸŸก Visual (Flash Fill + Power Query)

Pattern recognition (Ctrl+E) for one-off transforms. Power Query for repeatable pipelines on 10K+ rows. Both bypass formulas entirely when the situation calls for it.

TEXTBEFORE, TEXTAFTER, and TEXTSPLIT

If you have Excel for Microsoft 365 or Excel 2024, three newer functions make text extraction dramatically simpler. TEXTBEFORE returns the substring before a delimiter. TEXTAFTER returns what comes after. TEXTSPLIT breaks a string into an array of pieces by one or more delimiters. They handle the cases nested LEFT/RIGHT/MID formulas used to choke on.

Syntax: =TEXTBEFORE(text, delimiter, [instance_num]). The optional instance argument tells Excel which occurrence of the delimiter to stop at. So for "INV-2026-04481-CA" the formula =TEXTBEFORE(A2,"-",2) stops at the second hyphen and returns "INV-2026". Match that with =TEXTAFTER(A2,"-",2) to get "04481-CA" โ€” everything after the second hyphen.

Need just "04481"? Combine the two: =TEXTBEFORE(TEXTAFTER(A2,"-",2),"-"). TEXTAFTER first strips off the leading "INV-2026-", leaving "04481-CA". Then TEXTBEFORE chops at the next hyphen, returning "04481". One line. Readable. Maintainable. This is the modern way.

TEXTSPLIT is even better when you want every section at once. =TEXTSPLIT(A2,"-") returns a horizontal array: "INV", "2026", "04481", "CA" โ€” each in its own cell. Drag the result vertical with TRANSPOSE if you need a column. TEXTSPLIT also accepts a second delimiter for row splits, so you can break "name=John;age=42" into a 2ร—2 grid by passing both "=" and ";".

LEN and SUBSTITUTE: Counting and Cleaning

LEN returns the number of characters in a string, including spaces. It's the workhorse paired with text extraction. You'll see it most often as the "how many remaining characters" argument inside MID or RIGHT. =LEN(A2) on "INV-2026-04481-CA" returns 17.

SUBSTITUTE replaces occurrences of a substring inside text. Use it as a setup move before extraction. Example: you want the last segment after the final hyphen, but you don't know how many hyphens there are. Convert the final hyphen into a marker no other character matches โ€” like a tilde โ€” then use FIND to locate the marker.

Trick formula: =RIGHT(A2, LEN(A2) - FIND("~", SUBSTITUTE(A2, "-", "~", LEN(A2)-LEN(SUBSTITUTE(A2,"-",""))))). The fourth argument of SUBSTITUTE specifies which instance to replace. We replace the last instance by counting total hyphens (LEN minus LEN-without-hyphens). It's ugly. On Microsoft 365 you'd just write =TEXTAFTER(A2,"-",-1) โ€” the negative instance number means "count from the end." Use TEXTAFTER when you can.

Common Extraction Patterns

๐Ÿ“‹ Email Domain

Use FIND to locate the @, then MID grabs everything after it.

Formula: =MID(A2, FIND("@",A2)+1, LEN(A2))

For "claire.adams@gmail.com" this returns "gmail.com". Works regardless of name length because FIND adjusts per row.

๐Ÿ“‹ First Name

Find the first space, then LEFT grabs everything before it.

Formula: =LEFT(A2, FIND(" ",A2)-1)

For "Priya Iyer" returns "Priya". Add IFERROR for single-word entries that have no space.

๐Ÿ“‹ Last Segment

Microsoft 365 makes this trivial.

Formula: =TEXTAFTER(A2, "-", -1)

The negative instance number tells Excel to count from the end. Returns "CA" from "INV-2026-04481-CA" regardless of how many hyphens precede it.

๐Ÿ“‹ Middle Chunk

Two TEXTBEFORE/TEXTAFTER calls beat any nested MID.

Formula: =TEXTBEFORE(TEXTAFTER(A2,"-"),"-")

Returns "2026" from "INV-2026-04481-CA". Strips the prefix first, then cuts at the next delimiter.

Flash Fill: Excel Reads Your Mind

Flash Fill landed in Excel 2013 and changed everything for one-off jobs. You type the answer you want in the first cell, start typing the second, and Excel guesses the pattern. Press Ctrl+E to confirm. No formula. No FIND. Just pattern recognition that handles weird cases automatically.

Try it. Column A holds "Jordan Vasquez", "Priya Iyer", "Marcus Okonkwo-Adebayo". You want just the first names. In B2 type "Jordan". Hit Enter. Click B3 and press Ctrl+E. Excel fills "Priya" in B3 and "Marcus" in B4. It also handles the hyphen โ€” it didn't accidentally split inside Okonkwo-Adebayo because it learned the pattern from the first row: "everything before the first space."

Flash Fill is brilliant for ad-hoc work but has two limits. First, it doesn't update when source data changes โ€” it's a one-time fill, not a live formula. Second, on tricky patterns it sometimes guesses wrong, especially when the first example is ambiguous. If you need recalculating output, stick with formulas. If you need it once and you're done, Flash Fill saves minutes.

Power Query: When You Have 50,000 Rows

Power Query is Excel's industrial-strength text tool. Found under Data โ†’ Get & Transform, it pulls data from any source and lets you split, merge, clean, and transform columns through a visual interface. Behind the scenes it writes M-code, which means your steps replay every time you refresh โ€” no formulas to drag down.

Real example. You have 50,000 invoice codes pasted into a worksheet. Select the column, click From Table/Range, and the Power Query Editor opens. Choose Split Column โ†’ By Delimiter, set the delimiter to "-", and pick "Each occurrence." Click OK. Excel returns four columns. Rename them. Click Close & Load. The new columns appear back in your workbook. Refresh anytime to re-run.

Power Query also has dedicated extract operations under Transform โ†’ Extract: First Characters, Last Characters, Range, Text Before Delimiter, Text After Delimiter, Text Between Delimiters. Each is a clickable equivalent of the formulas above, but it scales to millions of rows without slowing your workbook.

Practice Excel Formulas and Functions Quiz

Common Errors and Fixes

Most extraction problems trace back to three issues. First, #VALUE! errors. FIND and SEARCH return this when the substring isn't present. Wrap them in IFERROR: =IFERROR(MID(A2, FIND("@",A2)+1, 255), ""). Now blank cells stay blank instead of breaking the sheet.

Second, hidden characters. Pasted data often contains non-breaking spaces (CHAR(160)) or trailing tabs that look identical to regular spaces. Run =CLEAN(TRIM(A2)) first to strip them. If FIND still can't locate your delimiter, the "space" you see might actually be a non-breaking space โ€” replace it with =SUBSTITUTE(A2, CHAR(160), " ").

Third, mixed-case mismatches. FIND is case-sensitive โ€” FIND("Inv", A2) won't match "INV". Switch to SEARCH or normalize with UPPER/LOWER first. For dates and numbers embedded in text, wrap the result in VALUE() so Excel treats the output as numeric โ€” otherwise sorting and SUM ignore it.

Choosing the Right Tool

Use LEFT/RIGHT/MID when positions are fixed and the data is clean. Use FIND or SEARCH to anchor those functions to delimiters when positions vary. Use TEXTBEFORE, TEXTAFTER, and TEXTSPLIT on Microsoft 365 โ€” they replace nested formulas with readable one-liners. Use Flash Fill for one-off jobs under 1,000 rows. Use Power Query when you need a repeatable pipeline that refreshes on new data.

One more rule of thumb. If you find yourself writing a formula longer than three nested FINDs, stop and ask whether TEXTSPLIT or Power Query would be cleaner. Future-you will thank present-you when you have to debug it six months later.

Practice With Realistic Data

Reading about text extraction is one thing. Doing it under time pressure is another. The fastest way to internalize these formulas is to drill them on the kind of data you'll actually meet โ€” order codes, email addresses, product SKUs, full names with optional middle initials, addresses with optional apartment numbers. Each pattern teaches a slightly different combination of FIND, SEARCH, and MID.

If you're prepping for an Excel certification or a job assessment, run through targeted question sets that mix extraction with formatting, lookups, and conditional logic. Mastery shows up not in knowing one formula but in choosing the right tool fast. The functions covered here โ€” combined with VLOOKUP, INDEX/MATCH, and the IF family โ€” cover roughly 80% of real-world Excel interview questions.

Build a small practice sheet, sprinkle in a few intentionally broken rows (missing delimiters, stray non-breaking spaces, mixed case), and try to fix them with the most concise formula possible. That deliberate friction is what turns rote knowledge into intuition.

Two final habits worth building. First, document the assumption your formula relies on โ€” even a one-line comment in an adjacent cell ("assumes A column contains exactly three hyphens") will save someone hours later. Second, write a quick LEN check column when you import new data; if expected lengths suddenly vary, you'll know to inspect the source before your extraction logic silently produces garbage.

Defensive habits like these separate someone who knows the formulas from someone who ships reliable spreadsheets. Pair them with structured testing โ€” a few "should fail gracefully" rows at the bottom of your sheet โ€” and you'll catch breakage the moment it appears rather than three weeks later when a stakeholder notices the numbers don't add up.

If you're moving into automation, the same logic applies in VBA and Office Scripts. The functions you've learned here map almost one-to-one onto string methods like Left, Right, Mid, InStr, and Split. Power Query's M-language uses Text.Start, Text.End, Text.Middle, Text.PositionOf, and Text.Split โ€” recognizable cousins of the worksheet versions. Skills in one tier carry over to the next. Master the formulas first and the rest comes naturally.

Before You Write the Formula

Inspect 5 random rows โ€” confirm the delimiter is consistent
Run TRIM and CLEAN to strip stray whitespace and hidden characters
Decide: fixed position (LEFT/RIGHT/MID) or anchored (FIND + MID)?
Check your Excel version โ€” TEXTSPLIT and TEXTBEFORE need Microsoft 365
Wrap in IFERROR if any rows might be missing the delimiter
Test on row 1, row 50, and the last row before dragging the full column
If extracting numbers, wrap output in VALUE() so SUM and sorting work

Flash Fill vs Formulas: Which Wins?

Pros

  • Flash Fill: Zero formula writing โ€” Ctrl+E and you're done
  • Flash Fill: Handles weird patterns Excel can infer from examples
  • Flash Fill: No #VALUE! errors, no nested function fatigue
  • Flash Fill: Perfect for one-off cleanup under 1,000 rows

Cons

  • Formulas: Live โ€” they update when source data changes
  • Formulas: Auditable โ€” your team can read what you did
  • Formulas: Reliable on edge cases Flash Fill might guess wrong
  • Formulas: Required when you need consistent behavior across Excel versions
Try Excel Functions Quiz

Excel Questions and Answers

How do I pick out certain text in Excel without using formulas?

Flash Fill is the fastest no-formula method. Type the result you want in the first cell next to your source data, start typing the second result, and press Ctrl+E. Excel detects the pattern and fills the column. For larger datasets or repeatable transforms, use Power Query under Data โ€” Get & Transform. It handles 50,000+ rows and refreshes automatically when source data updates.

What's the difference between LEFT, RIGHT, and MID functions?

LEFT pulls characters from the start of a string โ€” =LEFT(A2,3) gets the first 3 characters. RIGHT pulls from the end โ€” =RIGHT(A2,2) gets the last 2. MID pulls from any position you specify โ€” =MID(A2,5,4) starts at character 5 and grabs 4 characters. LEFT and RIGHT default to 1 character if you skip the count. MID requires all three arguments to work.

When should I use FIND vs SEARCH in Excel?

Use SEARCH when case doesn't matter โ€” it's case-insensitive and accepts wildcards like ? and *. Use FIND only when case matters, which is rare. Both return the position number where the substring starts and both return #VALUE! when the substring isn't present. SEARCH is the better default choice for most real-world tasks because data rarely has consistent capitalization.

Does TEXTSPLIT work in older versions of Excel?

No. TEXTSPLIT, TEXTBEFORE, and TEXTAFTER require Microsoft 365 or Excel 2024. They will return #NAME? errors in Excel 2019, 2021, or earlier. If you need to share workbooks with users on older versions, stick with nested LEFT/RIGHT/MID + FIND/SEARCH combinations. Check your Excel version under File โ€” Account before relying on the newer functions.

How do I extract text between two specific characters in Excel?

On Microsoft 365 use =TEXTBEFORE(TEXTAFTER(A2,"start"),"end") โ€” TEXTAFTER strips everything up to the first delimiter, then TEXTBEFORE cuts at the next. On older Excel use =MID(A2, FIND("start",A2)+LEN("start"), FIND("end",A2)-FIND("start",A2)-LEN("start")). The modern version is dramatically more readable and easier to maintain.

Why is my text extraction formula returning #VALUE!?

Most commonly because FIND or SEARCH couldn't locate the substring you asked for. Wrap the formula in IFERROR to handle missing delimiters gracefully โ€” =IFERROR(your_formula, ""). Other causes include hidden characters (run CLEAN and TRIM first), case mismatches with FIND (switch to SEARCH), or numbers stored as text (wrap output in VALUE).

Can I extract text from a cell based on a wildcard pattern?

Yes, with SEARCH. SEARCH accepts ? (any single character) and * (any sequence of characters). For example, =SEARCH("a?c", A2) finds positions where any character sits between 'a' and 'c'. For full regex-style extraction, use Power Query โ€” its Transform menu has Extract Values with regex support, far more powerful than worksheet functions.

How do I get just the numbers out of a mixed text-and-number cell?

On Microsoft 365 the cleanest approach is =TEXTJOIN("", TRUE, IFERROR(MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1)*1, "")). It scans each character and keeps only the digits. For one-off jobs, Flash Fill works โ€” type the extracted number in the first row and press Ctrl+E. Power Query also has a built-in Extract Digits transform that handles bulk cleanup.
โ–ถ Start Quiz