Related Function:

The OCT2HEX function converts an octal number to hexadecimal number.

### Syntax

=OCT2HEX(number,[places])

Note: Hexadecimal (base 16), decimal (base 10), octal (base 8), and binary (base 2) are the most commonly used numeral systems in engineering and computing. Therefore, Excel has provided functions to convert numeric values to and from each of these systems.

#### Arguments

Argument Description
number The octal number you want to convert

 • The number may not contain more than 10 octal characters (30 bits) • The most significant bit of number is the sign bit • The remaining 29 bits are magnitude bits • Negative numbers are represented using two’s-complement notation
[places] Optional. Defines the number of characters to use

 • If [places] is greater than the minimum, the hexadecimal number will be padded out using leading zeros • If [places] is omitted, OCT2HEX uses the minimum number of characters necessary

#### Examples

A B C
1 Formula Result  nowrap
2 =OCT2HEX(100, 4) 0040 Converts octal number 100 to hexadecimal form with 4 characters
3 =OCT2HEX(7777777533) FFFFFFFF5B Converts octal number 7777777533 to hexadecimal form
4 =OCT2HEX(“763”) 1F3 Converts octal number 763 to hexadecimal form

#### Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if the supplied [places] argument is not recognized as a number
#NUM! Occurs if either:

 • the supplied number argument is not recognized as an octal number • the supplied number argument contains more than 10 characters • the resulting hexadecimal number requires more places than is specified by the supplied [places] argument • the supplied [places] argument ≤ 0
#NAME? Occurs when Analysis ToolPak add-in is not enabled