The excel RIGHT function takes a number of characters in the text from the right.
RIGHT(text, [num_chars])
text, required, the text from which to extract the characters.
num_chars, optional, specifies the number of characters to extract.
The following are examples of the RIGHT function usage and the results.
=RIGHT(A2,0)
The RIGHT function returns nothing if the num_char argument is equal to 0.
=RIGHT(A3,3)
You get three letters taken from the rightmost position of cell A3.
=RIGHT(A4,1000)
If the num_char argument contains a number and larger than the text length, the result is the text itself.
=RIGHT(A5,-1)
You get a #VALUE! error if you put a negative number on the num_char argument.
=RIGHT(A6,2)
The RIGHT function able to extract from alphanumeric values, because alphanumeric is a number stored as text.
=RIGHT(A7,2)
The RIGHT function able to extract data from a number and the result is an alphanumeric value.
=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(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(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(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(A12,3)
4:29:17 PM returns the same result as number 0.687. Why? Because Excel stores times value as decimal numbers.
Calculate Number of Days Between Two Dates Excel has a function that calculates the number of days between two dates,…
What is Flash Fill Excel Flash Fill automatically fills your data when Excel detects a pattern in your initial data…
What is Paste Special Paste special is a paste but you can choose the result type. As we all know,…
What is the Excel TEXTJOIN Function? The excel TEXTJOIN function is the best function to concatenate strings in Excel, has…
What is the Excel CONCAT Function? The excel CONCAT function combines all data; it could be a text, a number…
What is the Excel CONCATENATE Function? The excel CONCATENATE function combines text or numbers into a text. CONCATENATE Syntax CONCATENATE(text1,…