RIGHT Function in Excel
The RIGHT function is a text string function that gives the number of characters from the right side of the string. It helps extract characters beginning from the rightmost side to the left. The result depends on the number of characters specified in the formula.
For example, โ=RIGHT(โAPPLESโ,2)โ gives โESโ as the result.
Similar to the RIGHT function, the LEFT function in excel returns the characters from the left side of the string.
Syntax
The syntax of the RIGHT function is stated as follows:

The RIGHT function accepts the following two arguments:
Key Takeaways
- Text: The text string that contains the characters to be extracted.
- Num_chars: The number of characters to be extracted from the string starting from the rightmost side.
The โtextโ is a mandatory argument and โnum_charsโ is an optional argument.
The Characteristics of โNum_Charsโ
The features of โnum_charsโ are listed as follows:
- The default value of โnum_charsโ is set at 1. This means that if the value of โnum_charsโ is omitted, the RIGHT function returns the last letter of the string.
- If โnum_charsโ is greater than the length of the text, the RIGHT function returns the complete text.
- If โnum_charsโ is less than zero, the RIGHT function returns the โ#VALUE! error.โ
Note: The RIGHT function should not be used with numbers. Though it performs the same operation on digits as it does with text, it returns wrong values with numbers formatted as text.
How To Use RIGHT Function in Excel?
The RIGHT function is mostly used in combination with other Excel functions like FIND, SEARCH, LEN, LEFT, etc.
The uses of the RIGHT function are listed as follows:
- It removes the trailing slash in URLs.
- It extracts the domain name from the email address.
- It helps format text.
- It extracts text occurring after a specific character.
Example #1
A text string is given in cell A3, as shown in the succeeding image. We want to extract the last word having six letters.

Let us apply the RIGHT formula to extract โstringโ in A3.
We use โ=RIGHT(A3,6).โ

The RIGHT formula returns โstring.โ

Example #2
The following image shows a list of IDs like โID2101,โ โID2102,โ โID2103,โ etc., in column A.
Here, the last four digits of the ID are unique and the text โIDโ is redundant. So, we want to remove โIDโ from the list of identifiers.

We apply the formula โ=RIGHT(A3,4).โ

The RIGHT function returns 2101 in cell B3. In the same way, we extract the last four digits of all the IDs.

Example #3
We have a 6-digit number (140111) and want to extract the last 3 digits from this number.

We apply the formula โ=RIGHT(A4,3)โ to extract the last three digits.

The RIGHT function returns 111.

Example #4
We have the date โ12/07/2018โ in cell A5. We want to extract the last few digits.

To extract the last three digits, we apply the formula โ=RIGHT(A5, 3).โ

The function returns 293 instead of 018. This is because it considers the original value of the date before returning the output. So, the RIGHT function does not give the correct answer in this case.
Example #5
We have the names of two animals in column A. The names are separated by a comma and space, as shown in the following image. We want to extract the last name.

We apply the following RIGHT formula.
โ=RIGHT(A4,LEN(A4)-FIND(โ โ,A4))โ
The โFIND(โ โ,A4)โ finds the location of the space. It returns 5. Alternatively, we can use โ,โ for a stricter search.
The โLEN(A4)โ calculates the length of the string โDog, Wolf.โ It returns 9.
The โLEN(A4)-FIND(โ โ,A4)โ returns the position of the space from the right. It returns 4.
The formula โRIGHT(A4,LEN(A4)-FIND(โ โ,A4))โ returns four letters from the right of the text string in A4.

The output of the RIGHT formula is โWolf.โ Similarly, we find the output for the remaining cells as well.

Example #6
We have two-dimensional data, the length multiplied by the width, as shown in the following image. We want to extract the width from the given dimensions.

For the first dimension, we apply the following RIGHT formula.
โ=RIGHT(B4,LEN(B4)-(FIND(โxโ,B4)+1))โ
The โFIND(โxโ,B4)โ gives the position of โxโ in the cell. It returns 8.
The formula โFIND(โxโ,B4)+1โ returns 9. Since โxโ is followed by a space, we add one to omit the space.
The โLEN(B4)โ returns the length of the string.
The โLEN(B4)-(FIND(โxโ,B4)+1)โ returns the number of characters occurring after โxโ+1.
The formula โRIGHT(B4,LEN(B4)-(FIND(โxโ,B4)+1))โ returns all the characters occurring in one place after โx.โ

The RIGHT formula returns โ150 ftโ for the first dimension. Drag the fill handle to get the results for the remaining cells.

Example #7
We have a list of email addresses. We want to extract the domain name from these email IDs.

We apply the following RIGHT formula to extract the domain name from the first email address.
โ=RIGHT(C3,LEN(C3)-FIND(โ@โ,C3))โ
The โFIND(โ@โ,C3)โ finds the location of โ@โ in the string. For cell C3, it returns 7.
The โLEN(C3)โ gives the length of the string C3. It returns 17.
The โLEN(C3)-FIND(โ@โ,C3)โ gives the number of characters occurring to the right of โ@.โ It returns 10.
The โRIGHT(C3,LEN(C3)-FIND(โ@โ,C3))โ gives the last 10 characters of cell C3.

The RIGHT formula returns โamazon.comโ in cell D3.

Similarly, we apply formulas to the remaining cells as well.

Example #8
We have some URLs shown in the following image. We want to remove the last backslash from these URLs.

We apply the following formula.
โ=LEFT(C3,LEN(C3)-(RIGHT(C3)=โ/โ))โ
By default, the RIGHT function returns one value on the rightmost side, i.e., the last value.
If the last character is a forward slash (/), โ(RIGHT(C3)=โ/โ)โ returns โtrue,โ else it returns โfalse.โ These โtrueโ and โfalseโ change to one and zero, respectively.
If the last character is a forward slash (/), one is subtracted from the length of the string. This means that if the last character is โ/โ, the โLEN(C3)-(RIGHT(C3)=โ/โ))โ omits it.
The โ=LEFT(C3,LEN(C3)-(RIGHT(C3)=โ/โ))โ returns the first โnโ number of characters. If the last character is a forward slash (/), it is omitted; else, the complete string is returned.

The formula returns the complete string in cell D3.

Similarly, we apply formulas to the remaining cells as well.

Frequently Asked Questions (FAQs)
#1 – What are the LEFT, RIGHT, and MID functions in Excel?
The LEFT and RIGHT functions extract characters or substrings from the left and the right side of the source string, respectively. The MID function extracts characters from the middle of the string.
The syntax of the three functions is stated as follows:
โ=LEFT(text, )โ
โ=RIGHT(text, )โ
โ=MID(text, start_num, num_chars)โ
The arguments are explained as follows:
– Text:ย The actual text string that contains the characters to be extracted. This is usually in the form of a cell reference.
– Num_chars: The number of characters to be extracted from the string.
– Start_num: The position within the source data string from where the extraction should
begin.
#2 – How to remove characters by using the RIGHT function in Excel?
The number of characters to be removed is subtracted from the total length of the string. For this, the following formula is used:
โ=RIGHT(string,LEN(string)-number_of_chars_to_remove)โ
The โstringโ is the entire source string. The โnumber_of_chars_to_removeโ contains the number of characters to be removed from the source string.
#3 – How to use the RIGHT function for numbers in Excel?
The RIGHT function always returns a text string even if the source string is in the form of numbers. To get the output as a number from a string of numbers, the RIGHT function is nested in the VALUE function.
The formula is stated as follows:
โ=VALUE(RIGHT(string, num_chars))โ
The โstringโ is the source string containing numbers. The โnum_charsโ is the number of digits to be extracted from the string.
Note: In Excel, the numbers string is right-aligned while the text string is left-aligned.
- The RIGHT function gives a specified number of characters from the right side of a text
string. - The RIGHT function extracts characters beginning from the rightmost side to the left.
- The RIGHT function accepts two argumentsโโtextโ and โnum_chars.โ
- The default value of โnum_charsโ is set at 1.
- If โnum_charsโ is greater than the length of the text, the RIGHT function returns the complete text.
- If โnum_charsโ is less than zero, the RIGHT function returns the โ#VALUE! error.โ
- The RIGHT function should not be used with numbers because it returns wrong values
with numbers formatted as text.
Recommended Articles
This has been a guide to RIGHT Function in Excel. Here we discuss the RIGHT Formula in Excel and how to use the RIGHT Excel function along with Excel examples and downloadable Excel templates. You may also look at these useful functions in Excel –