Free, no sign-up required

Text Extraction Formula Generator

Describe what part of a text string you need — the start, the end, a chunk in the middle, or everything before/after a character — and get a ready-to-use LEFT, RIGHT, or MID formula for Excel or Google Sheets.

5 free tries without an account

LEFT, RIGHT, and MID syntax

Syntax
=LEFT(text, [num_chars])
=RIGHT(text, [num_chars])
=MID(text, start_num, num_chars)

LEFT and RIGHT take a fixed character count from one end of the text; MID takes a chunk starting at any position. When the part you need isn't a fixed length, these are usually combined with FIND or SEARCH to locate a delimiter first. Formulon works out the exact combination for whatever text pattern you describe.

Examples

Extract an area code from a phone number

=LEFT(A2,3)

Takes the first 3 characters of the text in A2 — e.g. "555-1234" becomes "555".

Extract a domain from an email address

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

Finds the position of "@" in A2, then extracts everything after it to the end of the string — e.g. "jane@example.com" becomes "example.com", regardless of how long the name before the @ is.

Frequently asked questions

When do I use LEFT vs RIGHT vs MID?

LEFT pulls a fixed number of characters from the start of a text string, RIGHT pulls from the end, and MID pulls a chunk from anywhere in the middle given a starting position and length.

How do I extract text before or after a specific character?

Combine with FIND or SEARCH to locate the character's position dynamically, e.g. =MID(A2,FIND("@",A2)+1,LEN(A2)) extracts everything after an "@" symbol, regardless of where it falls in the string.

What's the difference between FIND and SEARCH?

FIND is case-sensitive and doesn't support wildcards. SEARCH is case-insensitive and does support wildcards (* and ?). Both return the character position of the text you're looking for, which is what LEFT/RIGHT/MID need to extract a variable-length substring.

Are LEFT, RIGHT, and MID the same in Google Sheets?

Yes, all three — along with FIND, SEARCH, and LEN — have identical syntax and behavior in Excel and Google Sheets.

Don't want to write it by hand?

Describe what you need in plain English and get a ready-to-use formula in seconds.

Try the formula generator