ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   dec 2 bin conversion (https://www.excelbanter.com/excel-worksheet-functions/208265-dec-2-bin-conversion.html)

Sai

dec 2 bin conversion
 
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.

Mike H

dec 2 bin conversion
 
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

"sai" wrote:

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.


Pete_UK

dec 2 bin conversion
 
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

On Oct 29, 6:52*pm, sai wrote:
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.




All times are GMT +1. The time now is 08:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com