OCT2HEX Function
The OCT2HEX function in Google Sheets converts an octal number to its hexadecimal equivalent.
Syntax
OCT2HEX(signed_octal_number, [significant_digits])
signed_octal_number
: The octal number you want to convert. This is a required parameter.significant_digits
: (Optional) The number of digits you want the hexadecimal number to contain.
Examples
- Basic Conversion
Convert the octal number 17 to hexadecimal:
=OCT2HEX(17)
This will output F.
- Conversion with Significant Digits
Convert the octal number 17 to hexadecimal with 4 significant digits:
=OCT2HEX(17, 4)
This will output 000F.
Notes
- The function can handle octal numbers up to 30 bits.
- If significant_digits is provided, the hexadecimal result will be padded with leading zeros to match the specified length.