BIN2HEX function

BIN2HEX(Number, DigitCount?) BIN2HEX(Number; DigitCount?)

Number

Text or { Text }

A binary number.

DigitCount

Number or { Number } (optional)

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

Returns

Text or { Text }

A hexadecimal number.

Converts a binary number to a hexadecimal number. Also consider using the more general functions BASE and DECIMAL. Perform the reverse conversion using HEX2BIN.

Examples

BIN2HEX("101")BIN2HEX("101")

Returns "5".

BIN2HEX("101", 4)BIN2HEX("101"; 4)

Returns "0005".

BIN2HEX("01111011")BIN2HEX("01111011")

Returns "7B".

BASE(DECIMAL("01111011", 2), 16)BASE(DECIMAL("01111011"; 2); 16)

Returns "7B".

BIN2HEX({ "101", "01111011" })BIN2HEX({ "101"; "01111011" })

Returns the array { "5", "7B" }{ "5"; "7B" }.