Engineering - HEX2OCT Function



Description

The HEX2OCT function converts a hexadecimal number to octal.

Syntax

HEX2OCT (number, [places])

Arguments

Argument Description Required/ Optional
number

The hexadecimal number you want to convert.

Number cannot contain more than 10 characters (40 bits). The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits.

Negative numbers are represented using two's-complement notation.

Required
places

The number of characters to use.

If places is omitted, HEX2OCT uses the minimum number of characters necessary.

Places is useful for padding the return value with leading 0s (zeros).

Optional

Notes

  • The Hexadecimal (Base 16) Numeral System uses the digits 0-9 and the characters A-F

  • The following table shows the first 32 hexadecimal values, along with the equivalent decimal values −

HEX2OCT Hexadecimal Values
  • As hexadecimals use the numbers 0-9 and the characters A-F, they should be enclosed in quotation marks when they are supplied to an Excel function. For example, the hexadecimal 11A should be input as "11A"

  • The Octal (Base 8) Numeral System uses the digits 0-7.

  • The following table shows the first 16 octal values, along with the equivalent decimal values −

HEX2OCT Octal Values
  • If number is negative, HEX2OCT ignores places and returns a 10-character octal number.

  • If number is negative, it cannot be less than FFE0000000

  • If number is positive, it cannot be greater than 1FFFFFFF

  • If number is not a valid hexadecimal number, HEX2OCT returns the #NUM! error value.

  • If HEX2OCT requires more than places characters, it returns the #NUM! error value.

  • If places is not an integer, it is truncated.

  • If places is nonnumeric, HEX2OCT returns the #VALUE! error value.

  • If places is negative, HEX2OCT returns the #NUM! error value.

Applicability

Excel 2007, Excel 2010, Excel 2013, Excel 2016

Example

HEX2OCT Function
advanced_excel_engineering_functions.htm
Advertisements