LEFT, RIGHT, MID and LEN Practice Questions with Solutions

Introduction

Excel text functions are useful when you need to extract specific parts of text from a cell. LEFT extracts characters from the beginning, RIGHT extracts characters from the end, MID extracts characters from a specific position, and LEN counts the total number of characters. In this chapter, you will practice these functions with employee IDs, product codes, phone numbers, email addresses, names, invoice numbers, and other practical datasets. LEFT, RIGHT, MID and LEN Practice questions with solutions to help you understand the concepts.


Question 1: Extract the First Characters Using LEFT

Problem Statement

You have employee IDs in the format EMP-101, EMP-102, etc. Extract the first three characters from each ID.

Excel Data

EmployeeEmployee IDPrefix
RahulEMP-101
PriyaEMP-102
AmitEMP-103
NehaEMP-104
ArjunEMP-105

Solution

In C2, enter:

=LEFT(B2,3)

Copy the formula down.

Expected Output

EmployeeEmployee IDPrefix
RahulEMP-101EMP
PriyaEMP-102EMP
AmitEMP-103EMP
NehaEMP-104EMP
ArjunEMP-105EMP

Question 2: Extract the Last Characters Using RIGHT

Problem Statement

A company stores product codes such as PROD-1001. Extract the last four digits from each product code.

Excel Data

ProductProduct CodeProduct Number
LaptopPROD-1001
MonitorPROD-1002
KeyboardPROD-1003
MousePROD-1004
PrinterPROD-1005

Solution

In C2, enter:

=RIGHT(B2,4)

Copy the formula down.

Expected Output

ProductProduct CodeProduct Number
LaptopPROD-10011001
MonitorPROD-10021002
KeyboardPROD-10031003
MousePROD-10041004
PrinterPROD-10051005

Question 3: Extract Characters from the Middle Using MID

Problem Statement

The employee IDs follow this format:

EMP-101-DEL

Extract the three-digit employee number from the middle of each ID.

Excel Data

EmployeeEmployee IDEmployee Number
RahulEMP-101-DEL
PriyaEMP-102-MUM
AmitEMP-103-NOI
NehaEMP-104-GUR
ArjunEMP-105-DEL

Solution

In C2, enter:

=MID(B2,5,3)

Copy down.

Expected Output

EmployeeEmployee IDEmployee Number
RahulEMP-101-DEL101
PriyaEMP-102-MUM102
AmitEMP-103-NOI103
NehaEMP-104-GUR104
ArjunEMP-105-DEL105

MID starts at the position you specify and extracts the number of characters you specify.


Question 4: Find the Length of Employee Names Using LEN

Problem Statement

Calculate the number of characters in each employee’s name.

Excel Data

EmployeeName Length
Rahul
Priya Sharma
Amit
Neha Kapoor
Arjun

Solution

In B2, enter:

=LEN(A2)

Copy the formula down.

Expected Output

EmployeeName Length
Rahul5
Priya Sharma12
Amit4
Neha Kapoor11
Arjun5

LEN counts spaces as characters.


Question 5: Extract the Area Code from a Phone Number

Problem Statement

Phone numbers are stored with an area code in the format:

011-45678901

Extract the first three characters as the area code.

Excel Data

Phone NumberArea Code
011-45678901
022-34567890
033-45671234
080-22334455
044-66778899

Solution

In B2, enter:

=LEFT(A2,3)

Copy down.

Expected Output

Phone NumberArea Code
011-45678901011
022-34567890022
033-45671234033
080-22334455080
044-66778899044

This is especially useful when the first part of a code or number follows a fixed structure.


Question 6: Extract the Domain Extension Using RIGHT and LEN

Problem Statement

Extract the last four characters from each email address to identify common domain extensions such as .com and .org.

Excel Data

EmailExtension
rahul@example.com
priya@example.org
amit@company.com
neha@school.org
arjun@business.com

Solution

In B2, enter:

=RIGHT(A2,4)

Copy down.

Expected Output

EmailExtension
rahul@example.com.com
priya@example.org.org
amit@company.com.com
neha@school.org.org
arjun@business.com.com

Question 7: Extract the First Name Using LEFT and FIND

Problem Statement

Names are stored as:

First Name Last Name

Extract only the first name.

Excel Data

Full NameFirst Name
Rahul Sharma
Priya Verma
Amit Kumar
Neha Kapoor
Arjun Singh

Solution

In B2, enter:

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

Copy down.

Expected Output

Full NameFirst Name
Rahul SharmaRahul
Priya VermaPriya
Amit KumarAmit
Neha KapoorNeha
Arjun SinghArjun

Here, FIND(" ",A2) locates the first space, and LEFT extracts everything before it.


Question 8: Extract the Last Name Using RIGHT, LEN and FIND

Problem Statement

Extract the last name from a full name.

Excel Data

Full NameLast Name
Rahul Sharma
Priya Verma
Amit Kumar
Neha Kapoor
Arjun Singh

Solution

In B2, enter:

=RIGHT(A2,LEN(A2)-FIND(" ",A2))

Copy down.

Expected Output

Full NameLast Name
Rahul SharmaSharma
Priya VermaVerma
Amit KumarKumar
Neha KapoorKapoor
Arjun SinghSingh

The formula uses LEN to determine the complete text length and FIND to locate the space.


Question 9: Extract Different Parts of a Product Code

Problem Statement

A product code follows this format:

ELEC-LAP-2026

Extract:

  1. Category → ELEC
  2. Product type → LAP
  3. Year → 2026

Excel Data

Product CodeCategoryProduct TypeYear
ELEC-LAP-2026
ELEC-MON-2026
COMP-KEY-2026
COMP-MOU-2026
HOME-PRI-2026

Solution

Category

In B2:

=LEFT(A2,4)

Product Type

In C2:

=MID(A2,6,3)

Year

In D2:

=RIGHT(A2,4)

Copy all three formulas down.

Expected Output

Product CodeCategoryProduct TypeYear
ELEC-LAP-2026ELECLAP2026
ELEC-MON-2026ELECMON2026
COMP-KEY-2026COMPKEY2026
COMP-MOU-2026COMPMOU2026
HOME-PRI-2026HOMEPRI2026

This example combines LEFT, MID, and RIGHT to break one structured code into separate columns.


Question 10: Create a Username from an Email Address

Problem Statement

Create a username by extracting everything before the @ symbol from each email address.

Excel Data

EmailUsername
rahul.sharma@gmail.com
priya.verma@yahoo.com
amit.kumar@outlook.com
neha.kapoor@gmail.com
arjun.singh@company.com

Solution

In B2, enter:

=LEFT(A2,FIND("@",A2)-1)

Copy down.

Expected Output

EmailUsername
rahul.sharma@gmail.comrahul.sharma
priya.verma@yahoo.compriya.verma
amit.kumar@outlook.comamit.kumar
neha.kapoor@gmail.comneha.kapoor
arjun.singh@company.comarjun.singh

This is a practical example of combining LEFT and FIND to extract variable-length text.


Key Takeaways

  • LEFT extracts characters from the beginning of a text string.
  • RIGHT extracts characters from the end of a text string.
  • MID extracts characters from a specific position.
  • LEN counts the number of characters in a cell.
  • Spaces are counted by LEN.
  • LEFT and FIND can be combined to extract text before a specific character.
  • RIGHT, LEN, and FIND can be combined to extract text after a specific character.
  • MID is useful when the required text is located in the middle of a structured value.
  • These functions are useful for employee IDs, product codes, email addresses, phone numbers, names, and reference numbers.
  • Combining text functions makes Excel useful for cleaning and separating structured data.

FAQs

1. What does LEFT do in Excel?

LEFT extracts a specified number of characters from the beginning of a text value.

=LEFT(A2,5)

This extracts the first five characters.

2. What does RIGHT do in Excel?

RIGHT extracts characters from the end of a text value.

=RIGHT(A2,4)

This extracts the last four characters.

3. What does MID do in Excel?

MID extracts characters from a specified starting position.

=MID(A2,5,3)

This starts at character 5 and extracts 3 characters.

4. What does LEN do in Excel?

LEN counts the number of characters in a cell, including spaces.

=LEN(A2)

5. Does LEN count spaces?

Yes. Spaces are counted as characters by LEN.

6. Can LEFT and FIND be used together?

Yes. This is useful when you want to extract text before a specific character.

=LEFT(A2,FIND("@",A2)-1)

7. Can RIGHT and LEN be used together?

Yes. They can be combined with FIND to extract text after a particular character.

=RIGHT(A2,LEN(A2)-FIND(" ",A2))

8. What is the difference between LEFT and MID?

LEFT always starts extracting from the first character. MID allows you to specify where the extraction should start.

9. Can these functions be used with numbers?

Yes, but Excel treats the values as text during these text operations. If you need the extracted result to behave as a number in calculations, you may need to convert it to a number.

10. Why are LEFT, RIGHT, MID and LEN important in Excel?

They are useful for cleaning, separating, and analyzing text-based data such as IDs, codes, names, email addresses, invoice numbers, and other structured information.

Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.

Scroll to Top