How to Use RIGHT Function in Excel: Extract Text from Right Side
Use the
RIGHT function in Excel to get a set number of characters from the end of a text string. The formula looks like =RIGHT(text, num_chars), where text is your string and num_chars is how many characters you want from the right side.Syntax
The RIGHT function has two parts:
- text: The text string you want to extract characters from.
- num_chars: The number of characters to take from the right end of the text.
If num_chars is omitted, Excel returns just the last character.
excel
=RIGHT(text, num_chars)
Example
This example shows how to get the last 4 characters from the word "Spreadsheet".
excel
=RIGHT("Spreadsheet", 4)
Output
heet
Common Pitfalls
Common mistakes include:
- Forgetting to put the text in quotes if typing directly in the formula.
- Using a
num_charslarger than the text length, which returns the whole text without error. - Leaving
num_charsblank unintentionally, which returns only the last character.
excel
=RIGHT("Excel", 10) <em>Returns "Excel" because 10 is more than text length</em>
Output
Excel
Quick Reference
| Parameter | Description | Example |
|---|---|---|
| text | The text string to extract from | "Hello World" |
| num_chars | Number of characters from right to extract | 5 |
| Return | Extracted characters from right side | "World" |
Key Takeaways
RIGHT extracts characters from the end of a text string in Excel.
Use =RIGHT(text, num_chars) where num_chars is how many characters you want.
If num_chars is larger than text length, the whole text is returned.
Omitting num_chars returns only the last character.
Always put text in quotes if typing directly in the formula.