OCT2HEX Function in Google Sheets

Convert an octal number to a hexadecimal number using the OCT2HEX function.

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

  1. Basic Conversion

Convert the octal number 17 to hexadecimal:

=OCT2HEX(17)

This will output F.

  1. 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.
  • OCT2BIN: Convert an octal number to a binary number.
  • OCT2DEC: Convert an octal number to a decimal number.