Features of !SEMTools

RIGHT

RIGHT function in Excel, simple examples
Function categoryText
VolatilityNon-volatile
Similar functionsLEFT, MID

What does RIGHT do?

The RIGHT function returns the rightmost part of the referenced value, with the specified number of characters. In other words, it allows to extract the last N characters of a cell or another object to which it is applied.

The function is only useful when the number of characters to extract from the right side of the string is fixed and known in advance.

In practice, this number often needs to be calculated, which requires searching from the end of the string from right to left in a cell. Since there is no simple function for this (the SEARCH and FIND functions search from left to right), methods for solving this problem are covered in a separate article.

RIGHT syntax

=RIGHT(Text, Number_of_Characters)

The second argument is optional. If omitted (not specified), the formula returns one last character.

If the second argument is equal to or exceeds the length of the string, the entire original cell text is returned.

If it equals zero – an empty string is returned.

If a negative number is specified, a #VALUE! error is returned.

RIGHT – formatting

As with LEFT, any numeric formats (date, date-time, currency, percentage) are converted to a natural number and only then to string format.

Therefore, for correct text extraction of part of the characters, the TEXT function may be needed.

Application

The following table was used to extract a person’s last name from a cell containing their first and last name.

  1. The FIND function finds the position of the space between the first and last name
  2. The length of the last name is calculated by subtracting the space position from the total text length of the cell, which in turn is calculated by the LEN function
  3. The RIGHT function then extracts the last name from the specified position
RIGHT function example extracting second word
Extracting the second word using the RIGHT function

Other formula examples with RIGHT

The function is extremely in demand in various scenarios. Below is a list of articles that use formulas with the RIGHT function:

Remove first letter / first N characters at the beginning or end of a cell in Excel

Number and amount in words in Excel

SUMPRODUCT function

IF function in Excel

Excel VALUE function

Extract last characters from cells in Excel

Like the article? Help its author! Buy !SEMTools, it has lots of useful instruments to process text data.

This post is also available in RU.