Practice by topic / Excel / Text Functions

LEFT, RIGHT, MID Exercises

Imported data is messy: extra spaces, inconsistent capitals, codes glued together. Text functions clean and reshape it without retyping anything. These 10 exercises build up step by step, starting with extract an area code, extract a file extension, extract a middle code segment.

3 of 10 free · no sign-up needed · graded on the formula you write

1

Extract an Area Code

Free

A1 holds a 10-digit phone number as text like '5551234567'. Write a formula in A2 that extracts the first 3 characters (area code) using LEFT.

A
15551234567
2?
Show the solution

Use =LEFT(A1,3).

Right — LEFT(text,3) grabs the first 3 characters from the start of the string.

Expected result in A2: 555

Try it in the live spreadsheet →
2

Extract a File Extension

Free

A1 holds a filename like 'report.pdf'. Write a formula in A2 that extracts the last 3 characters (the extension) using RIGHT.

A
1report.pdf
2?
Show the solution

Use =RIGHT(A1,3).

Good — RIGHT(text,3) grabs the last 3 characters from the end of the string.

Expected result in A2: pdf

Try it in the live spreadsheet →
3

Extract a Middle Code Segment

Free

A1 holds a code like 'US-4821-X'. Write a formula in A2 that extracts the 4 digits in the middle using MID (starting at position 4).

A
1US-4821-X
2?
Show the solution

Use =MID(A1,4,4).

Right — MID(text,4,4) starts at the 4th character and takes 4 characters from there.

Expected result in A2: 4821

Try it in the live spreadsheet →
4

Extract a Year From a Date String

A1 holds a date string like '2024-03-15'. Write a formula in A2 that extracts the first 4 characters (the year) using LEFT.

A
12024-03-15
2?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
6

Extract a Middle Initial Section

A1 holds a name-coded string like 'John-M-Smith'. Write a formula in A2 that extracts the middle initial (1 character starting at position 6) using MID.

A
1John-M-Smith
2?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
8

Extract a Currency Suffix

A1 holds a formatted amount like '129.99USD'. Write a formula in A2 that extracts the last 3 characters (currency code) using RIGHT.

A
1129.99USD
2?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
10

Extract a State Abbreviation

A1 holds an address string like 'Austin, TX'. Write a formula in A2 that extracts the last 2 characters (state) using RIGHT.

A
1Austin, TX
2?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →