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.
You need a Microsoft Excel installed on your device.
A basic knowledge in Text function is required to understand the 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] )
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.
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)
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
.
If you want to extract the last few digits of the date, then the RIGHT()
function wouldn't give you an exact result:
The Excel RIGHT
function returns 95
instead of 97
. This is because the original date value is taken and it gives a result.
#VALUE!
- The formula will output this error when the optional argument (num_chars) is less than 0
.
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?
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.
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.