Cellgrids Cellgridsby LearnWithRinkesh
Home › Excel tutorials › LEFT, RIGHT and MID Functions in Excel

LEFT, RIGHT and MID Functions in Excel: Extract Text Easily

By Rinkesh Shah · Business Analyst, 8 years in data · Updated 2026-10-31

▶ Video coming soon

These three functions cut a piece of text out of a cell.

LEFT: characters from the start

=LEFT(A2, 3) returns the first 3 characters. For LAP-2045 it gives LAP.

RIGHT: characters from the end

=RIGHT(A2, 4) returns the last 4 characters. For LAP-2045 it gives 2045.

MID: characters from the middle

=MID(A2, start, count)

=MID(A2, 5, 2) starts at character 5 and takes 2 characters. For LAP-2045 it gives 20.

Combine with FIND and LEN

Results are text

These functions return text, even for digits. To use the result as a number, wrap it in VALUE, or multiply by 1.

In Microsoft 365, TEXTBEFORE and TEXTAFTER do the same job with less typing.

Worked example

A2 holds "INV-2026-045". =LEFT(A2,3) returns INV. =RIGHT(A2,3) returns 045. =MID(A2,5,4) returns 2026: start at character 5 and take 4.

Common mistakes

Frequently asked questions

How do I take text before a character?

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

How do I get the last word?

=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",50)),50)).

What if the length is longer than the text?

You just get the whole text, with no error.

Practice this online, free

Reading is only half of learning Excel. Cellgrids is a free place for online Excel practice: solve Excel formula exercises in a live spreadsheet, prepare for Excel interview questions, and work through business case studies built for data analytics and business analytics roles.

Practice these formulas: LEFT, RIGHT, MID, LEN.

Start Excel practice → Case studies