[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

BIN2DEC

Syntax:

BIN2DEC ( number )

Description: Makes the decimal equivalent of number.

Arguments:

Name

Type

Description

number

number

A 10-digit binary number that is to be converted to a decimal string. 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 (10th 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-binary digits, #NUM! is returned.

number contains more than 10 binary digits; that is, number is outside the range 1000000000 (-512 decimal) to 0111111111 (511 decimal), inclusive, #NUM! is returned.

[Example:

BIN2DEC(111) results in 7
BIN2DEC(11111111) results in 255
BIN2DEC(1111111110) results in -2
BIN2DEC(1000000000) results in -512

end example]