What is the Excel RIGHT Function?
The excel RIGHT function takes a number of characters in the text from the right.
RIGHT Syntax
RIGHT(text, [num_chars])
text, required, the text from which to extract the characters.
num_chars, optional, specifies the number of characters to extract.
- If the num_char argument omitted, it is assumed to be 1.
- If the num_chars argument larger than the text length, the RIGHT function returns the text itself.
- If the num_char argument is a negative number, the RIGHT function returns a #VALUE! error
How to Use RIGHT Function in Excel
The following are examples of the RIGHT function usage and the results.
RIGHT Function #1
=RIGHT(A2,0)
The RIGHT function returns nothing if the num_char argument is equal to 0.
RIGHT Function #2
=RIGHT(A3,3)
You get three letters taken from the rightmost position of cell A3.
RIGHT Function #3
=RIGHT(A4,1000)
If the num_char argument contains a number and larger than the text length, the result is the text itself.
RIGHT Function #4
=RIGHT(A5,-1)
You get a #VALUE! error if you put a negative number on the num_char argument.
RIGHT Function #5
=RIGHT(A6,2)
The RIGHT function able to extract from alphanumeric values, because alphanumeric is a number stored as text.
RIGHT Function #6
=RIGHT(A7,2)
The RIGHT function able to extract data from a number and the result is an alphanumeric value.
RIGHT Function #7
=RIGHT(A8,2)
If a number has been formatted in a certain format, the RIGHT function only extracts the numbers and ignores the format.
RIGHT Function #8
=RIGHT(A9,2)
Why did the RIGHT function return the same result for date 2/29/2020 and number 43890? Because Excel stores date values in integer numbers. 2/29/2020 is the cell format. The actual data is number 43890.
As mentioned before the RIGHT function only takes the numbers and ignores the format.
To be clearer about how Excel stores date and time data, read the following article:
RIGHT Function #9
=RIGHT(A10,2)
Why the RIGHT function returns the different result for cell A9 and cell A10?
Look carefully at the date in cell A9, by default right aligned if you see in the formula bar, no quotes in front of it. It means cell A9 contains a date value.
While date in cell A10 by default left aligned, if you see in the formula bar, there is a single quote in front of the “date”. It means cell A10 contains a text value. The RIGHT function will extract two characters from the right; the result is 20.
RIGHT Function #10
=RIGHT(A11,3)
The RIGHT function can extract a decimal number and consider the decimal separator as one character, not a formatted cell that is ignored.
RIGHT Function #11
=RIGHT(A12,3)
4:29:17 PM returns the same result as number 0.687. Why? Because Excel stores times value as decimal numbers.