The OCT2HEX function in Google Sheets is a powerful tool for converting signed octal numbers into their corresponding signed hexadecimal formats. This function is particularly useful for users who work with various numeral systems and need to switch between octal and hexadecimal easily. By understanding and applying this function, users can enhance their data manipulation capabilities significantly.
Syntax
OCT2HEX(octal_number, [places])
- octal_number: The signed octal number that you wish to convert into hexadecimal.
- places: (Optional) The number of characters to use for the output. If the output has fewer characters than this value, it will be padded with leading zeroes.
Example #1
OCT2HEX("72")
This function call converts the octal number 72 into its hexadecimal equivalent, resulting in 1A.
Example #2
OCT2HEX("-10")
This function call transforms the signed octal number -10 into its signed hexadecimal equivalent, yielding -8.
Example #3
OCT2HEX("200", 4)
This usage converts the octal number 200 into hexadecimal while ensuring the result has at least 4 characters, resulting in 00C8 after padding with leading zeroes.
Error handling
- NUM!: This error appears when the provided octal number is invalid or out of the acceptable range for conversion.
- VALUE!: This error is displayed if the input is not a valid number or is formatted incorrectly.