In Excel: use =LEFT(text, n) to take the first n characters, =RIGHT(text, n) to take the last n, and =MID(text, start, n) to take n characters beginning at a position — the three text-extraction functions.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
text | required | The source text or cell to extract characters from. |
num_chars | required | How many characters to return; for MID this is the length of the slice. |
start_num | optional | MID only: the position of the first character to return (1 = the first character). |
Related functions
For the first characters, type =LEFT(, click the cell, type a comma and the number of characters, such as =LEFT(A2, 3).
For the last characters, type =RIGHT(A2, 3) the same way — it counts from the end instead of the start.
For a middle slice, type =MID(, click the cell, then give the start position and the length: =MID(A2, 4, 3).
To split at a delimiter, replace the fixed numbers with FIND(" ", A2) so the position adjusts to each row.
Press Enter and fill the formula down the column.
What this does
LEFT, RIGHT and MID pull a slice of characters out of a longer string. LEFT takes characters from the start, RIGHT from the end, and MID takes a run of characters beginning at a position you give it. LEFT and RIGHT each need just the text and a count; MID needs the text, the starting position, and how many characters to take. Paired with FIND or SEARCH (which return the position of a character such as a space), they split first and last names dynamically without hard-coding lengths. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “extract text between two characters”. Start on a copy or a tiny sample, keep the affected cells visible, and compare the result with the outcome you expected before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a text operation that turns messy entries into clean, usable data, but the practical win is that someone else can open the file and understand what happened without asking you.
A worked example
Take the product code "ABC123" in A2. =LEFT(A2, 3) returns "ABC", =RIGHT(A2, 3) returns "123", and =MID(A2, 4, 3) returns "123" by starting at the 4th character. To split a full name in B2 like "Maria Klein" at the space: =LEFT(B2, FIND(" ", B2) - 1) returns "Maria", and =MID(B2, FIND(" ", B2) + 1, 100) returns "Klein" — FIND locates the space so the formula works whatever the name length. LEFT, RIGHT and MID are the everyday tools for splitting codes, names and IDs into parts — area codes, file extensions, first and last names — especially when teamed with FIND or SEARCH for variable-length data. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. Keep this page bookmarked for the next time the same question comes up. Better still, repeat the steps once in your own workbook — doing it yourself is what turns a copied answer into something you remember. For “extract text between two characters”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Mixing up
MIDarguments — the order is text, start_num, then num_chars, not text, length, start; the second number is where to begin. - Using a fixed number of characters for names or codes of varying length; combine with FIND or SEARCH so the count adapts to each cell.
- Counting
MIDpositions from 0 — the first character is position 1, so=MID(A2, 1, 3)takes the first three characters.
Frequently asked questions
How do I extract text before a space or symbol?
Combine LEFT with FIND: =LEFT(A2, FIND(" ", A2) - 1) returns everything before the first space. Subtracting 1 stops the result just short of the space itself.
What is the difference between MID and LEFT or RIGHT?
LEFT and RIGHT always start at one end of the text, while MID starts at any position you specify. Use MID when the characters you want are in the middle, not at the start or end.
How do I get the last characters of a cell?
Use RIGHT with the count you need: =RIGHT(A2, 4) returns the final four characters. To take everything after a symbol, pair RIGHT with LEN and FIND to compute the remaining length.
Other ways people ask this
On the way here you may have searched this as “excel extract text from string between characters”, “excel find text between two characters”, “text between excel” and “how to extract text between two characters in excel” — it is all the same task, and this page is the single, complete answer to it.
Why do people search for this in so many different ways?
Because the same task has many names. “excel extract text from string between characters”, “excel find text between two characters”, “text between excel” all point at the one operation explained on this page, which is why they all lead here.