What is the RIGHT Function in Excel?
The RIGHT Function in Microsoft Excel is a Text Function that extracts a specified number of characters from the right side of a text string.
It is useful when you want to extract the last few characters from a name, code, mobile number, product ID, or any other text value.
For example, if a cell contains EXCEL12345, the RIGHT function can extract the last five characters, 12345.
Syntax of the RIGHT Function
=RIGHT(text, [num_chars])Arguments:
text: The text string or cell reference from which you want to extract characters.
num_chars: The number of characters you want to extract from the right side. This argument is optional. If omitted, Excel returns one character.
Examples of the RIGHT Function in Excel
Example 1: Extract the Last Characters
Suppose cell A2 contains the text Microsoft Excel.
Formula:
=RIGHT(A2,5)Result: Excel
Explanation: The formula extracts the last five characters from cell A2.
Example 2: Extract the Last Four Digits
Suppose cell A2 contains EMP20245678.
Formula:
=RIGHT(A2,4)Result: 5678
Explanation: The formula returns the last four characters from the employee ID.
Example 3: Extract the Last Three Characters
Suppose cell A2 contains INV-987654.
Formula:
=RIGHT(A2,3)Result: 654
Explanation: Excel extracts the last three characters from the specified text.
Example 4: Use the RIGHT Function Without num_chars
Suppose cell A2 contains Excel.
Formula:
=RIGHT(A2)Result: l
Explanation: If you omit the second argument, Excel returns only the last character.
Practical Example of the RIGHT Function
Consider the following employee data:
| Employee ID | Formula | Result |
|---|---|---|
| EMP10025 | =RIGHT(A2,3) | 025 |
| EMP10036 | =RIGHT(A3,3) | 036 |
| EMP10047 | =RIGHT(A4,3) | 047 |
This technique is useful when extracting the last digits from employee IDs, invoice numbers, product codes, and other records.
Important Points to Remember
The RIGHT function extracts characters from the right side of a text string.
If
num_charsis omitted, Excel returns one character.If
num_charsis greater than the length of the text, Excel returns the entire text.If
num_charsis negative, Excel returns a#VALUE!error.The RIGHT function returns text, even when the extracted characters look like numbers.
Difference Between LEFT, MID and RIGHT Functions
| Function | Purpose | Example |
|---|---|---|
| LEFT | Extracts characters from the beginning | =LEFT("EXCEL123",5) → EXCEL |
| MID | Extracts characters from a specified position | =MID("EXCEL123",6,3) → 123 |
| RIGHT | Extracts characters from the end | =RIGHT("EXCEL123",3) → 123 |
Conclusion
The RIGHT function is a simple and useful Excel text function for extracting characters from the end of a text string. It can help you clean data, extract codes, and manage employee IDs, invoice numbers, and product information.
If you want to improve your Microsoft Excel skills, practise the RIGHT function with real-world data and combine it with other text functions such as LEFT, MID, LEN, and FIND.
