The BIN2DEC function

Contents

Welcome back to our frequent blog of Excel functions from A to Z. Today we look at the BIN2DEC function.

The BIN2DEC function

This function converts a binary number (base two) in a decimal number (base 10).

The BIN2DEC The function uses the following syntax to operate:

The BIN2DEC The function has the following arguments:

  • number: this is required and represents the binary number you want to convert to decimal
  • number cannot contain more than 10 characters (10 bits)
  • the most significant part of number is the bit sign
  • the remaining nine bits are bits of magnitude
  • negative numbers are represented using two's complement notation.

Two's complement is a mathematical operation on binary numbers, as well as a representation of signed binary numbers based on this procedure. The two's complement of a North-number of bits is set as the complement with respect to 2North; In other words, is the result of subtracting the number of 2North. This is also equivalent to taking the complement of ones and later adding one, since the sum of a number and the complement of its ones is 1 bits. The two's complement of a number behaves like the negative of the original number in most arithmetic operations, and positive and negative numbers can coexist naturally.

In English, then, if the number has 10 digits and the first number is 1, the number is considered negative and 29 (512) if it remains, p.ej BIN2DEC (1111111111) = -1, being 511 (111111111 as a decimal) less 512.

It should be noted at the same time that IF number is not a valid binary number, or if the number contains more than 10 characters (10 bits), BIN2DEC return the #ON ONE! error value.

Please, see my example below:

Subscribe to our Newsletter

We will not send you SPAM mail. We hate it as much as you.