RIGHT Function in Excel

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 IDFormulaResult
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

  1. The RIGHT function extracts characters from the right side of a text string.

  2. If num_chars is omitted, Excel returns one character.

  3. If num_chars is greater than the length of the text, Excel returns the entire text.

  4. If num_chars is negative, Excel returns a #VALUE! error.

  5. The RIGHT function returns text, even when the extracted characters look like numbers.

Difference Between LEFT, MID and RIGHT Functions

FunctionPurposeExample
LEFTExtracts characters from the beginning=LEFT("EXCEL123",5) → EXCEL
MIDExtracts characters from a specified position=MID("EXCEL123",6,3) → 123
RIGHTExtracts 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.

Learn more Excel functions and practical Excel tutorials at Learn Excel VBA Macro.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top