View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default BIN2DEC conversion for large binary numbers

Pete,

I just checked E2003 and you are correct but there is no such explanation of
this limitation in E2007 help reproduced below

A number system is a systematic way to represent numbers with symbolic
characters and uses a base value to conveniently group numbers in compact
form. The most common number system is decimal, which has a base value of 10,
and a symbolic character set of 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. However,
there are other number systems, and they can be more efficient to use for a
specific purpose. For example, because computers use Boolean logic to perform
calculations and operations, they use the binary number system, which has a
base value of 2.

Microsoft Office Excel has several functions that you can use to convert
numbers to and from the following number systems:

Mike

"Pete_UK" wrote:

XL Help tells you why the answer is wrong - you are limited to 10 bits
and the msb is the sign bit. Chop the number up into bytes (8 bits)
and treat each part separately, remembering to multiply by 256 for the
upper byte.

Hope this helps.

Pete

On Dec 15, 5:13 pm, Mike H wrote:
Hi,

Well I think it's 822 and my calculator confirms that and like you I get
-202. Someone will no doubt explain why but in the meantime use this

=SUMPRODUCT(MID("0"&A1,ROW(INDIRECT("1:"&LEN("0"&A 1))),1)*2^(LEN("0"&A1)-ROÂ*W(INDIRECT("1:"&LEN("0"&A1)))))

Where your binary number is in A1

Mike



"ahmedmidany" wrote:
Hello All,


I need your help, i want to convert large binary numbers using excel
but whenever i use the BIN2DEC function the result is negative which
is not correct.


Ex. BIN2DEC(1100110110) the result is -202 but if i use the calculator
the result is 822 which is the correct value


Any ideas? what shall i do to have the correct value?


Thanks in advance
A.M.
.- Hide quoted text -


- Show quoted text -


.