The Excel RIGHT Function: What It Is and How It Works
The Indeed Editorial Team comprises a diverse and talented team of writers, researchers and subject matter experts equipped with Indeed's data and insights to deliver useful tips to help guide your career journey.
If you use Excel in the workplace, you may be interested in learning about certain techniques you can apply to this program. One of these helpful techniques is the RIGHT function. Using this function can make it easier to pull out characters that begin from the rightmost side and place them to the left. In this article, we explore what the Excel RIGHT function is, how it works, how to implement this technique when using the program and examples of this function.
What is the Excel RIGHT function?
The Excel RIGHT function is a text string that provides how many characters are on the right side of a string. This function allows users to return the last characters in a text string, depending on how many characters they specify. It also pulls out characters that begin on the rightmost side of the left side of the Excel sheet. Using this function makes it easier to identify characters and move them to the right side when needed.
How does the Excel RIGHT function work?
The RIGHT function works by returning a certain number of characters from the bottom of a text string. The syntax for the RIGHT function is as follows:
Within this syntax, the text is a required element and refers to the text string from which you want to pull characters. The num_chars element is optional and provides the code with the number of characters extracted. The default number for the nums_chars code is one. This means that if you don't include a value for this code, the RIGHT function extracts the last letter of a text string. If the value of the nums_chars code is larger than the original text, it extracts the entire text.
The RIGHT function will always bring back a text string, no matter what the current value is. For example, if the current value is a number, the code will still produce a text string rather than a number string. For this reason, you may only want to use text when working with this function. Otherwise, it may return incorrect values of the numbers in the form of text.
How to use the RIGHT function in Excel
The following are steps and formulas to help you use the RIGHT function in Excel in relation to three different uses for this function:
1. Get a substring that follows a specified character
If you want to find and extract a specific character from a text string or substring, you can use either the FIND or SEARCH element to see where the character is located. You can then remove the character from the string by returning it with the LEN function. This allows you to extract the specific character from the right side of the first string. The code you can use when implementing this function is as follows:
RIGHT(string, LEN(string) - SEARCH(character, string))
You can also use this function to develop a substring that comes after other characters, such as semicolons or commas. If you want to do so, you can use the following code:
2. Extract a substring from the last appearance of a delimiter
You may use this function to extract a text string from more complicated strings, such as characters that occur at various times within the same delimiter. This may require you to pull the text located to the right of the last occurrence of the delimiter. Here are the steps you can follow to do so:
Pull the number of delimiters located in the original string using the LEN function.
Determine the length of the text string with no delimiters with the SUBSTITUTE function.
Subtract the total length of the first text string with no delimiters from the final string length.
Use a distinct character to replace the delimiter.
Determine the exact position of the delimiter from the text string.
Return the text string to the rightmost side of the delimiter.
Code involved in this process includes:
Using the LEN function:
Using the SUBSTITUTE function code:
Finding the position of the last delimiter:
Returning the text string to the rightmost area of the last delimiter:
3. Remove the original N characters from a text string
In addition to pulling a text string from the rightmost side of the string, you can also use the RIGHT function to remove various characters from the start of the string. The following is the code required to perform this function:
Examples of the Excel RIGHT function
The following are examples of implementing the RIGHT function in Excel:
Here's an example of using the RIGHT function when extracting a substring that follows a specific character:
You can use pull a number from a text string with the VALUE and RIGHT functions:
This is an example of using the RIGHT function to pull a domain name from an Excel sheet with emails:
You may also implement the RIGHT function when adjusting a URL:
Troubleshooting for the Excel RIGHT function
Some users may come across issues when using the RIGHT function. The following are a few troubleshooting questions with answers to help you best use this function:
Can I use the RIGHT function to extract a number?
The RIGHT function only returns a text string, even if the character's original status is a numeral. There's a way to get around this, though. If you turn the RIGHT function into the VALUE function, it turns a text string into the form of a number or numbers.
Does the RIGHT function allow users to find dates?
In most cases, the RIGHT function won't work with dates. This is because numerals in the program represent dates, and the RIGHT function won't return numbers. If you attempt to extract dates, it only provides you with the last four numbers of the date as represented in the program.
Will the RIGHT function work if the nums_chars is less than zero?
Most users don't use negative numbers when performing the RIGHT function. If you do use a negative number, you'll likely receive a #VALUE! error. When this happens, consider reviewing the nested RIGHT function for issues.
Please note that none of the companies mentioned in this article are affiliated with Indeed.
Explore more articles
- 11 Types of Help Desk Software for Professionals
- 30 Strategies To Help Managers Retain Talent
- 13 Best Practices for Working Remotely
- 23 Effective Ways To Generate More Real Estate Leads
- Nonprofit Accounting: What It Is and How To Perform It (With Best Practices)
- Remote Whiteboarding (Definition and Features To Consider)
- How To Create a Social Media Calendar in 5 Steps
- What Is Supply Chain?
- FAQ: How Often Should Businesses Post on Social Media?
- 30 Online Masters in Clinical Psychology Programs
- All About Management Consulting
- 10 Diversity in the Workplace Benefits