The RIGHTB function in Google Sheets is a powerful tool that enables users to extract a specified number of bytes from the right side of a text string. This can be particularly useful for manipulating and managing data that consists of varying character lengths or for extracting information from standardized text formats.
Syntax
RIGHTB(text, num_bytes)
- text: The original text string from which you want to extract the right portion.
- num_bytes: The number of bytes you wish to extract from the right side of the text.
Example #1
RIGHTB("Google Sheets", 6)
In this example, the function extracts the last six bytes of the string “Google Sheets”, resulting in the output: “Sheets”.
Example #2
RIGHTB("Data Analysis", 4)
Here, the function retrieves the last four bytes of the string “Data Analysis”, producing the result: “ysis”.
Example #3
RIGHTB("Byte Extraction", 8)
This function call extracts the last eight bytes from “Byte Extraction”, yielding the output: “traction”.
Error handling
- VALUE! – This error occurs when the “num_bytes” parameter is non-numeric or negative.
- REF! – This error appears if the “text” input refers to a cell that is invalid or does not exist.