**RIGHT **is another popular function in MS Excel that is used to get the last character or characters in a text string, based on the specific number of characters. In one word, this function is designed to return a specified number of characters from the rightmost side of a string. This article will share the complete idea of how the **RIGHT **function works in Excel independently and then with other Excel functions.

**Table of Contents**hide

## Download the Practice Workbook

**RIGHT Function in Excel (Quick View)**

**Excel RIGHT Function: Syntax & Arguments**

**Summary**

**Syntax**

=RIGHT (**text**, [num_chars])

**Arguments**

Argument |
Required or Optional |
Value |
---|---|---|

text |
Required | Pass the text from which to extract characters on the right. |

[num_chars] | Optional | Pass the number of characters to extract, starting on the right. The default value is 1. |

**Note:Â **

- If num_chars is not provided, it defaults to 1.
- If num_chars is greater than the number of characters available, the
**RIGHT**function returns the entire text string. **RIGHT**will extract digits from numbers as well as text.- This function does not consider the formatting of any cell. Like a date, currency, etc.

**How to Use the RIGHT Function in Excel (6 Examples)**

**Example 1: How to Get a Substring that Comes after a Certain Character**

Letâ€™s assume we have a dataset of customers with their Name, Order ID, Address, Total Price. Now we will extract the last name of each customer from their full name using the **RIGHT **function.

**Step 1:** Enter the formula in cell **C4**

`=RIGHT(B4,LEN(B4)-SEARCH(" ",B4))`

**Formula Explanation**

**SEARCH(â€ť â€ś, B4)**this portion finds the space from the Full name cells.- Then
**LEN(B4)-SEARCH(â€ť â€ś, B4)**this portion will select the last part of the name. - Then the
**RIGHT**function will return the selected portion.

**Example 2: How to Extract a Substring after the Last Occurrence of the Delimiter**

Now consider we have a dataset of customer comments. There in each comment, there is a comments number like Comments 1, Comments 2, etc. Now our task is to extract the only comments from the source comment.

**Step 1:** Enter the formula in cell **D4 **and copy up to **D11**

`=RIGHT(C4,LEN(C4)-SEARCH("$",SUBSTITUTE(C4,":","$",LEN(C4)-LEN(SUBSTITUTE(C4,":","")))))`

**Formula Explanation**

**LEN(SUBSTITUTE(C4,â€ť:â€ť,â€ťâ€ť))**this portion finds the colon (:) sign in the whole string.**SUBSTITUTE(C4,â€ť:â€ť,â€ť#â€ť,LEN(C4)-LEN(SUBSTITUTE(C4,â€ť:â€ť,â€ťâ€ť)))**this part replaces the last delimiter with some unique character.- Then
**SEARCH(â€ś#â€ť, SUBSTITUTE(A2,â€ť:â€ť,â€ť#â€ť,LEN(A2)-LEN(SUBSTITUTE(A2,â€ť:â€ť,â€ťâ€ť))))**this part gets the position of the last delimiter in the string. Depending on what character we have replaced the last delimiter with, use either case-insensitive**SEARCH**or case-sensitive FIND to determine the position of that character in the string. - Lastly, the
**RIGHT**function selected comments and print them.

**Example 3: How to Remove the First N Characters from a String Using RIGHT Function**

The above task can be done using a simple formula. As there is a fixed number of characters â€ś**Comment N**â€ť which is 10 in the first portion of each comment, we can easily eliminate it and get the comment only. Here we will remove the first 10 characters from the Source Comment and print the only comments in a separate column.

**Step 1:** Enter the formula in cell **D4 **and copy it down up to **D11**

`=RIGHT(C4, LEN(C4)-10)`

**Formula Explanation**

**LEN(C4)-10**this will return a number after subtracting 10 from the total characters number. If the total length is 25 then this portion will return 25-10 = 15- Then the
**RIGHT**function will return the only comment from the source comment.

**Example 4: Extract Number from a String Using RIGHT and VALUE Function**

The **RIGHT **function does not allow the return of a number from any string. It returns the number in text format. But using the **VALUE **and **RIGHT **functions we can return numbers in the correct format. Here we will use the same dataset above and we will extract the ZIP Code in number format from the Address column.

**Step 1:** Enter the formula in cell **F4 **and copy it down up to **F11**

`=VALUE(RIGHT(E4, 5))`

**Formula Explanation**

**RIGHT(E4, 5)**this portion gives the 5 characters from the address which is zip code in text format.- Then
**VALUE**function converts them into number format.

**Example 5: Extract Domain Name from Email using RIGHT Function**

Letâ€™s have a customer dataset with their Order ID, Name, Email, and Address. Now we will find out their email domain from the given email address using the **RIGHT **function.

**Step 1:** Enter the formula in **F4 **and copy it down up to **F11**

`=RIGHT(E4,LEN(E4)-FIND("@",E4))`

**Formula Explanation**

**FIND(â€ś@â€ť,E4)**this portion find @ from the given string.**LEN(E4)-FIND(â€ś@â€ť, E4)**this will give the number up to which the value will be extracted.

**Example 6: Modify URL Using RIGHT Function**

This RIGHT function also helps us to modify any type of URL. Letâ€™s in our dataset we have several URLs of some websites. Now in some of them is a backslash / in the URL. Now our task is to find out those URLs and remove this backslash from the URL.

**Step 1:** Enter the formula in cell **C4 **and copy it down up to **C8**

`=LEFT(B4,LEN(B4)-(RIGHT(B4)="/"))`

**Formula Explanation**

- If the last character is a forward slash (/),
**(RIGHT(B4)=â€ť/â€ť)**returns â€śtrue,â€ť else it returns â€śfalse.â€ť - The
**=LEFT(B4, LEN(B4)-(RIGHT(B4)=â€ť/â€ť))**returns the first â€śnâ€ť number of characters. If the last character is a forward slash (/), it is omitted; else, the complete string is returned.

**User Problems with RIGHT Function**

*Can the Excel*As mentioned at the beginning of this tutorial, the**RIGHT**function return a number?**RIGHT**function in Excel always returns a text string even if the original value is a number.*Why doesnâ€™t the*Since the Excel**RIGHT**function work with dates?**RIGHT**function is designed to work with text strings whereas dates are represented by numbers in the internal Excel system, a RIGHT function is unable to retrieve an individual part of a date such as a day, month, or year. If you attempt to do this, all you will get is a few last digits of the number representing a date.

**Things to Remember**

Common Errors |
When they show |
---|---|

#VALUE! | If â€śnum_charsâ€ť is less than zero, the RIGHT function returns this error. |

**Conclusion**

Thatâ€™s it all about the **RIGHT **function. Here I have tried to give a summary of this function and its different applications. I have shown multiple methods with their respective examples but there can be many other iterations depending on numerous situations. If you have any inquiries or feedback, please let us know in the comment section.

Hi – I am trying to write a formula to extract the name and address from these strings. My thought was to try to do an IF statement since they either start with PRM-OC-SF-Note or PRM-SF-Deed of Trust. Something like IF cell = “PRM-OC-SF-Note” then remove the first 42 characters but IF cell = “PRM-SF-Deed of Trust” then remove the first 53 characters. Then I can do a comma delimited for the rest. But I am not sure how to combine and IF function with a Left/Right trim. Also not sure if there is a better formula

Client Column

PRM-OC-SF-Note – 5/28/2010 – 0001111111- DOE – JANE – 111 WINDY AVE – SINGLE FAMILY – OMITTED – – – – -144444444

PRM-SF-Deed of Trust – 11/11/2008 – 0001111111 – DOE – JANE – 111 WINDY AVE – SINGLE FAMILY – – – – – – -1444444444

PRM-OC-SF-Note – 8/18/2008 – 0033333333 – DOE – JIM – 1222 OXFORD CIR – SINGLE FAMILY – – – – – -1433333333

PRM-SF-Deed of Trust – 7/1/2008 – 0033333333 – DOE – JIM – 1222 OXFORD CIR – SINGLE FAMILY – PAID OFF – – – – – 1593-1433333333

PRM-OC-SF-Note – 9/15/2009 – 0034444444- SMITH – JOHN – 333 ELMWOOD PKWY – GINNIE MAE – SECURITIZED – 0222222222 – 0000000000 – 11/3/2009 – 5/20/2010-1455555555

PRM-SF-Deed of Trust – 7/8/2014 – 0034444444- SMITH – JOHN – 333 ELMWOOD PKWY – GINNIE MAE – SECURITIZED – 0222222222 – – – – -1455555555