ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   BIN2HEX function will convert '511', but not '512' (https://www.excelbanter.com/excel-worksheet-functions/85908-bin2hex-function-will-convert-511-but-not-512-a.html)

pellis

BIN2HEX function will convert '511', but not '512'
 
BIN2HEX is acting really wierd. BIN2HEX(511) works fine. BIN2HEX(512)
returns a #NUM! error.

Also, can't figure out how to input a hex number into the worksheet. If I
input '43E2', the worksheet will NOT recognize this as a hex number. Is
there some type of indicator I need to use? Could not find ANYTHING in the
help sections.

[email protected]

BIN2HEX function will convert '511', but not '512'
 
BUT 511 and 512 are DECIMAL's not binary numbers, so it shouldn't work
with EITHER - DEC2HEX would return a value. And 43E2 is translated to
17152 using HEX2DEC when typed normally onto my sheet.


Bob Phillips

BIN2HEX function will convert '511', but not '512'
 
Are you sure that 511 gets converted. BIN2HEX converts a binary number to
hex, so it can only consist of 0 and 1.

Also, =HEX2DEC("43E2") worked for me.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"pellis" wrote in message
...
BIN2HEX is acting really wierd. BIN2HEX(511) works fine. BIN2HEX(512)
returns a #NUM! error.

Also, can't figure out how to input a hex number into the worksheet. If I
input '43E2', the worksheet will NOT recognize this as a hex number. Is
there some type of indicator I need to use? Could not find ANYTHING in

the
help sections.




JE McGimpsey

BIN2HEX function will convert '511', but not '512'
 
In article ,
pellis wrote:

BIN2HEX is acting really wierd. BIN2HEX(511) works fine. BIN2HEX(512)
returns a #NUM! error.


Something else is going on BIN2HEX requires a binary argument, not a
decimal. Both should give #NUM! errors.

Also, can't figure out how to input a hex number into the worksheet. If I
input '43E2', the worksheet will NOT recognize this as a hex number. Is
there some type of indicator I need to use? Could not find ANYTHING in the
help sections.


43E2 is parsed as scientific notation - 43 E+02 or 43 * 10^2

Either preformat the cell as Text or prefix the entry with an apostrophe
(').

Jerry W. Lewis

BIN2HEX function will convert '511', but not '512'
 
In either Excel 2000 or 2003, BIN2HEX(511) returns #NUM!, as it should (since
511 is not binary as other replies have noted).

If you meant that =BIN2HEX(DEC2BIN(511)) returns '1FF', but
=BIN2HEX(DEC2BIN(512)) returns #NUM!; that is because =DEC2BIN(512) also
returns #NUM!, as documented in Help.

Jerry

"pellis" wrote:

BIN2HEX is acting really wierd. BIN2HEX(511) works fine. BIN2HEX(512)
returns a #NUM! error.

Also, can't figure out how to input a hex number into the worksheet. If I
input '43E2', the worksheet will NOT recognize this as a hex number. Is
there some type of indicator I need to use? Could not find ANYTHING in the
help sections.



All times are GMT +1. The time now is 05:22 PM.

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