How to Use the Excel Right Function

Introduction

This article tutorial will discuss on how use the right function in Excel to extract a set of characters from the right side of a text string.

Prerequisites

You need a Microsoft Excel installed on your device.
A basic knowledge in Text function is required to understand the right function.

Excel RIGHT function

The function RIGHT extracts a certain set of characters from the rightmost side of a given text string.

The RIGHT() formula syntax is:

RIGHT( text, [num_chars] )
  • text - It is required argument. It used to extract characters from the right.
  • num chars- It is an optional argument. It refers to number of extract characters starts at right.

The RIGHT() function returns a text string at all times, although this may include digits and may seem like a number. This could be necessary when you want to use the function result within other formulas or function.

Excel formula for RIGHT function

To demonstrate how does the right function works, let's make an example. Always start the formula with an equal sign (=). Suppose you have a text in A2 and you want to extract the last 8 characters:

=RIGHT(A2,8)

Screenshot of the Excel RIGHT function getting substring

The result of right example formula would return into function.

Suppose you want to extract the last two numbers from a 5-digit number value placed into cell A2, and the last two numbers were 52.

Here is how you do it:

=RIGHT(A2,2)

The result for using RIGHT() formula turned to 52.

Excel RIGHT function example using DATE

If you want to extract the last few digits of the date, then the RIGHT() function wouldn't give you an exact result:

Screenshot of the Excel formula for RIGHT function getting DATE substring

The Excel RIGHT function returns 95 instead of 97. This is because the original date value is taken and it gives a result.

Excel RIGHT function VALUE error

#VALUE! - The formula will output this error when the optional argument (num_chars) is less than 0.

Excel RIGHT function with dates

The common mistakes fall under the MID(), LEFT(), or RIGHT() functions with date. Dates are stored as numbers in Excel and it's only the formatting cells that makes them appear as dates into your worksheet.

Thus, whenever you try to use those function on a date, the function returns the mid, start or end characters of the number that reflects that date.

How to solve this problem?

  • Use the day, the month or the year functions to extract each data of the date.
  • When you don't use the dates in other formulas that depend on them to be stored as numbers, you can use the Text To Columns tool to convert the cells that contain dates to text.

Step 1: Select the cells you want to convert into text. This should not extend into more than one column.
Step 2: Go to Data tab then, click on Text to Columns option.
Step 3: Select Delimited option and click on Next.
Step 4: Unchecked all the list under Delimiters then, click Next.
Step 5: You will have a selection for Column Data Formats. Choose the Text and click on Finish.

You will now save the data as text in Excel in your selected cells and the Right formula will work as intended.

Conclusion

We hope that the information about the excel right function included in this article helped you accomplish your task. Text manipulation and extraction like this comes in very handy so keep this function in your toolbelt.

Published: 
July 6, 2020
Author:
500 Rockets
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram