# Excel String Functions: LEFT, RIGHT, MID, LEN and FIND

In this guide, you’ll see how to use the Excel string functions to retrieve specific characters from a string in Excel.

Specifically, you’ll observe how to apply the following Excel string functions using practical examples:

## Excel String Functions

To start, suppose that you stored different strings in Excel that contain a mixture of:

• Letters
• Digits
• Symbols
• Spaces

The ultimate goal is to isolate/retrieve only the digits within those strings.

### Retrieve a specific number of characters from the left side of a string

In the example below, you’ll see 3 strings. Your goal is to retrieve only the 5 digits from the left-side:

(1) First, type/paste the table below into Excel, within the range of cells A1 to B4:

Since the goal is to retrieve the first 5 digits from the left, you’ll need to use the LEFT formula, which has the following structure:

`=LEFT(Cell where the string is located, Number of characters needed FROM THE LEFT)`

(2) Next, type the following formula in cell B2:

``=LEFT(A2,5)``

(3) Finally, drag the LEFT formula from cell B2 to B4 in order to get the results across your 3 records.

This is how your table would look like in Excel after applying the LEFT formula:

### Retrieve a specific number of characters from the right side of a string

To retrieve the 5 digits from the right-side of the strings:

(1) Type/paste the following table into cells A1 to B4:

Here, use the RIGHT formula that has the following structure:

`=RIGHT(Cell where the string is located, Number of characters needed FROM THE RIGHT)`

(2) Then, type the following formula in cell B2:

``=RIGHT(A2,5)``

(3) Finally, drag your RIGHT formula from cell B2 to B4.

This is how the table would look like after applying the RIGHT formula:

### Get a specific number of characters from the middle of a string

To retrieve the 5 digits from the middle of the strings:

(1) Type/paste the following table into cells A1 to B4:

Here, use the MID formula with the following structure:

`=MID(Cell of string, Start position of first character needed, Number of characters needed)`

(2) Now type the following formula in cell B2:

``=MID(A2,4,5)``

(3) Finally, drag the MID formula from cell B2 to B4.

This is how the table would look like:

### Gel all characters before a symbol (for varying-length strings)

To retrieve all the desired digits before a symbol (e.g., the hyphen symbol “-“) for varying-length strings:

(1) First, type/paste the following table into cells A1 to B4:

Here, you’ll need to use the FIND function to find your symbol:

`=FIND(the symbol in quotations that you'd like to find, the cell of the string)`

(2) Then, type the following formula in cell B2:

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

Note that the “-1” at the end of the formula simply drops the hyphen symbol from the final results.

(3) As before, drag your formula from cell B2 to B4 to see the complete results:

### Gel all characters before a space (for varying-length strings)

To get all the digits before a space for varying-length strings:

(1) To start, type/paste the following table into cells A1 to B4:

(2) Then, type the following formula in cell B2 (here, simply leave an empty space within the double quotes):

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

(3) Finally, drag the formula from cell B2 to B4:

### Obtain all characters after a symbol (for varying-length strings)

To get all the digits after the hyphen symbol (“-“) for varying-length strings:

(1) First, type/paste the following table into cells A1 to B4:

(2) Secondly, type the following formula in cell B2:

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

(3) Finally, drag your formula from cell B2 to B4:

### Obtain all characters between two symbols (for varying-length strings)

To retrieve only the digits between the two hyphen symbols for varying-length strings:

(1) First, type/paste the following table into cells A1 to B4:

(2) Then, type the following formula in cell B2:

``=MID(A2,FIND("-",A2)+1,FIND("-",A2,FIND("-",A2)+1)-FIND("-",A2)-1)``

(3) And finally, drag your formula from cell B2 to B4: