BIN2HEX function will convert '511', but not '512'

G

Guest

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.
 
A

aidan.heritage

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.
 
B

Bob Phillips

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)
 
J

JE McGimpsey

pellis said:
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
(').
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top