HEX2OCT function

HEX2OCT(Number, DigitCount?) HEX2OCT(Number; DigitCount?)

Number

Text or { Text }

A hexadecimal number.

DigitCount

Number or { Number } (optional)

The number of digits to return. If omitted, the minimum number of digits necessary to accurately represent the number is used.

Returns

Text or { Text }

An octal number.

Converts a hexadecimal number to an octal number. Also consider using the more general functions BASE and DECIMAL. Perform the reverse conversion using OCT2HEX.

Examples

HEX2OCT("5")HEX2OCT("5")

Returns "5".

HEX2OCT("5", 4)HEX2OCT("5"; 4)

Returns "0005".

HEX2OCT("7B")HEX2OCT("7B")

Returns "173".

BASE(DECIMAL("7B", 16), 8)BASE(DECIMAL("7B"; 16); 8)

Returns "173".

HEX2OCT({ "5", "7B" })HEX2OCT({ "5"; "7B" })

Returns the array { "5", "173" }{ "5"; "173" }.