View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default BIN2DEC conversion for large binary numbers

On Tue, 15 Dec 2009 08:19:13 -0800 (PST), 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.


There is a way to use BIN2DEC with large numbers, but I can't recall it.

You could use:

=SUMPRODUCT(--MID(A1,LEN(A1)+1-ROW(INDIRECT("1:"&LEN(A1))),1),(2^(ROW(INDIRECT("1 :"&LEN(A1)))-1)))

Just be aware that if your value is more than 15 digits, you must enter it as
text.
--ron