The RIGHT function in Excel allows you to extract characters from the end (right side) of a text string. This is useful when you only need a specific portion of text, such as the last few digits of an account number, a file extension, product codes, or employee IDs.
In business environments, the RIGHT function is commonly used to clean data, separate codes, and pull meaningful information from long text strings without manually editing cells.
In This Guide, You’ll Learn
- What the RIGHT function does in Excel
- How to write the RIGHT formula correctly
- How to extract text from the right side of a cell
- Real-world business examples using RIGHT
- Common mistakes to avoid
- Practical ways to combine RIGHT with other functions
What is the RIGHT Function?
The RIGHT function extracts a specified number of characters from the end of a text string. You tell Excel how many characters you want, and Excel returns them starting from the far right.
RIGHT Function Syntax
=RIGHT(text, [num_chars])
Argument Definitions
- text – The text string or cell reference you want to extract characters from.
- num_chars – Optional. The number of characters you want Excel to return from the right side. If omitted, Excel returns 1 character.
Example Dataset Used in This Tutorial
You can download the sample data we’ll be using in this tutorial by clicking on this link—> RIGHT Function Data
Basic RIGHT Function
In this example, we will extract the last 3 characters from a product code.

Formulas Used
=RIGHT(A2,3)
=RIGHT(A3,3)
=RIGHT(A4,3)
=RIGHT(A5,3)

The formula tells Excel to return the last 3 characters from each text string.
Extracting the Last 4 Digits of an Account Number
Many companies only display the last four digits of sensitive account numbers.

Formulas Used
=RIGHT(A2,4)
=RIGHT(A3,4)
=RIGHT(A4,4)
=RIGHT(A5,4)

This is useful for reporting where you want to partially hide account information.
Extracting File Extensions
Businesses often work with exported reports and file types. RIGHT can identify the file extension.

Formulas Used
=RIGHT(A2,4)
=RIGHT(A3,3)
=RIGHT(A4,3)
=RIGHT(A5,4)

This can help sort or organize files automatically.
Extracting Department Codes from Employee IDs
Suppose employee IDs end with a department code.

Formulas Used
=RIGHT(A2,2)
=RIGHT(A3,2)
=RIGHT(A4,2)
=RIGHT(A5,2)

This is a practical way to separate embedded business information inside IDs.
Common RIGHT Function Mistakes
Requesting Too Many Characters
If you ask for more characters than exist in the text, Excel simply returns the entire text string.
Example:
=RIGHT("Excel",10)
Result: Excel
Forgetting num_chars
If you leave out the second argument, Excel only returns one character.
Example:
=RIGHT(A2)
This returns only the final character.
Numbers Stored as Text
RIGHT treats everything as text, including numbers.
This is usually helpful, but it can occasionally cause issues if you expect a numeric result for calculations.
Example Dataset Used in This Tutorial
You can download the sample data we’ll be using in this tutorial by clicking on this link—> RIGHT Function Data




