dec 2 bin conversion

  • Thread starter Thread starter sai
  • Start date Start date
S

sai

I need to calculate the binary conversion of numbers > 511. Is there any
option for it as I am getting a #NUM error whenever i try to calculate that.
 
Hi,

Dec2bin runs out of steam at >511 try this for larger No's

=DEC2BIN((MOD(A1,4294967296)/16777216),8) &
DEC2BIN(MOD(A1,16777216)/65536,8) & DEC2BIN(MOD(A1,65536)/256,8) &
DEC2BIN(MOD(A1,256),8)

Mike
 
Excel Help tells you that the range of numbers that can be used is
limited to -512 up to +511, as a maximum of 10 places is available for
output (2^10 = 1024).

If you need to show more places then you could split the number by
repeated division by, say, 256, and combine the output strings
together, or you could use a UDF to do the conversion.

Hope this helps.

Pete
 
Back
Top