The RIGHT function in Google Sheets is a powerful tool used to extract a specified number of characters from the end of a given text string. This function is especially useful for manipulating and analyzing text data, allowing users to focus on the most relevant parts of strings, whether for formatting or data extraction purposes.
Syntax
RIGHT(text, [num_chars])
- text: The string from which you want to extract characters.
- num_chars: The number of characters to extract from the right end of the string. If omitted, it defaults to 1.
Example #1
RIGHT("Google Sheets", 6)
This function extracts the last six characters from the string “Google Sheets”, resulting in: “Sheets”.
Example #2
RIGHT("Data Analysis", 2)
Here, the function fetches the last two characters from “Data Analysis”, leading to: “is”.
Example #3
RIGHT("Statistics", 3)
In this case, it extracts the last three characters from “Statistics”, resulting in: “cs”.
Error handling
- VALUE!: This error occurs if the num_chars parameter is non-numeric or negative.
- REF!: Triggered when the text argument refers to an invalid cell reference.
- N/A: Occurs when the function cannot return an array due to a non-existent character position.