Table of Contents
Excel’s MID function allows users to extract a specific number of characters from a given string, starting from any position. By using this function, we can easily create a formula to extract characters from the right side of a string. The formula will require the input of the string, the starting position of the extraction, and the number of characters to be extracted. This process can be helpful in various data analysis tasks, such as separating last names from full names or extracting specific characters from a longer string. By using the MID function, Excel provides a simple and efficient way to manipulate and extract data from strings.
Excel: A Formula for MID From Right
The MID function in Excel allows you to extract a specific number of characters from a string based on a starting position on the left side of the string.
However, you can use the following formula to replicate the MID function and extract a specific number of characters using a starting position on the right side of the string:
=RIGHT(REPLACE(A1, LEN(A1)-start_from_right+2, LEN(A1),""), num_characters)For example, you can use the following formula to extract the 4 middle characters in cell A1 starting 3 positions from the right:
=RIGHT(REPLACE(A1,LEN(A1)-3+2,LEN(A1),""), 4)
The following example shows how to use this formula in practice.
Example: Using MID From Right in Excel
Suppose we have the following list of basketball team names in Excel:

We can type the following formula into cell B2 to extract the 4 middle characters from the team name in cell A2 starting 3 positions from the right:
=RIGHT(REPLACE(A2,LEN(A2)-3+2,LEN(A2),""), 4)
We can then click and drag this formula down to each remaining cell in column B:

Column B now displays the 4 middle characters from each team name starting 3 positions from the right.
For example, consider the first team name:
- Mavericks
The 3rd position from the right is the letter c:
- Mavericks
We then extract the 4 characters starting from this position:
- Mavericks
The result is eric.
The formula repeats this process for each name in the Team column.
The following tutorials explain how to perform other common tasks in Excel:
Cite this article
stats writer (2024). How can we use Excel to create a formula for extracting characters from the right side of a string using the MID function?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-we-use-excel-to-create-a-formula-for-extracting-characters-from-the-right-side-of-a-string-using-the-mid-function/
stats writer. "How can we use Excel to create a formula for extracting characters from the right side of a string using the MID function?." PSYCHOLOGICAL SCALES, 26 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-we-use-excel-to-create-a-formula-for-extracting-characters-from-the-right-side-of-a-string-using-the-mid-function/.
stats writer. "How can we use Excel to create a formula for extracting characters from the right side of a string using the MID function?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-we-use-excel-to-create-a-formula-for-extracting-characters-from-the-right-side-of-a-string-using-the-mid-function/.
stats writer (2024) 'How can we use Excel to create a formula for extracting characters from the right side of a string using the MID function?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-we-use-excel-to-create-a-formula-for-extracting-characters-from-the-right-side-of-a-string-using-the-mid-function/.
[1] stats writer, "How can we use Excel to create a formula for extracting characters from the right side of a string using the MID function?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can we use Excel to create a formula for extracting characters from the right side of a string using the MID function?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
