[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

HEX2DEC

Syntax:

HEX2DEC ( number )

Description: Makes the decimal equivalent of number.

Arguments:

Name

Type

Description

number

string

A 10-digit hexadecimal number in a string that is to be converted to a decimal number. number is not case-sensitive. If number has less than 10 digits, leading zero digits are implied until it has exactly 10 digits. The 10 digits use twos-complement representation with the left-most bit (40th bit from the right) representing the sign bit.

 

Return Type and Value: number – The decimal equivalent of number.

However, if

number contains one or more non-hexadecimal digits, #NUM! is returned.

number contains more than 10 hexadecimal digits; that is, number is outside the range "8000000000" (-548,755,813,888 decimal) to "7FFFFFFFFF" (548,755,813,887 decimal), inclusive, #NUM! is returned.

[Example:

HEX2DEC("fE") results in 254
HEX2DEC("FFFFFFFFFE") results in -2
HEX2DEC("F000000000") results in -68719476736

end example]