Is there a cell format for HEX numbers?

G

Guest

Hello.

Is there a way to format cells for HEX numbers? I currently have to format
them as text. I would like to be able to automatically increment in HEX, as I
can with general numbers or dates. Is this possible without writing a macro?
 
G

Guest

Betty said:
Hello.

Is there a way to format cells for HEX numbers? I currently have to format
them as text. I would like to be able to automatically increment in HEX, as I
can with general numbers or dates. Is this possible without writing a macro?
To display a decimal number as hex use:

[ ] = DEC2HEX(A1,n)

If it doesn't appear to be part of your Excel setup, then you've got to
install the Analysis ToolPak that came with Excel and enable it
properly. See the help files that Excel provides.

Bill
 
D

Dave O

When I read the original post it sounds like Betty is starting off with
Hex notation, rather than converting from decimal. If I read it
correctly she needs the Hex entries to be mathematically active within
Excel so she can add to them.

If this is correct, then the best I can come up with is to nest the
HEX2DEC and DEC2HEX formulas to convert Hex to decimal, perform the
increment, and convert back to Hex.

For instance: with the entry A5 in cell A1, the formula in B1 that
increments Hex A5 by decimal 1 is
=DEC2HEX(HEX2DEC(A1)+1)

Betty, are we getting close to an answer you can use?
 
G

Guest

Dave said:
When I read the original post it sounds like Betty is starting off with
Hex notation, rather than converting from decimal. If I read it
correctly she needs the Hex entries to be mathematically active within
Excel so she can add to them.

If this is correct, then the best I can come up with is to nest the
HEX2DEC and DEC2HEX formulas to convert Hex to decimal, perform the
increment, and convert back to Hex.

For instance: with the entry A5 in cell A1, the formula in B1 that
increments Hex A5 by decimal 1 is
=DEC2HEX(HEX2DEC(A1)+1)

Betty, are we getting close to an answer you can use?

What I meant to imply was that you just let the computer your
calculations in decimal in cell A1 and echo them over to B1 formatted in
hex. Let the computer work in decimal while you watch in hex.

Bill
 
G

Guest

Thank you both. The spreadsheet I'm working in uses Hex notations - one block
per row, but there are gaps in sequence. I need to fill in those gaps and
continue with new entries. So, I've created a simple fix on another worksheet
-

In cell A1, I enter the existing Hex number
In B1, =HEX2DEC(A1)
In B2, =B1+4096
In C1, =DEC2HEX(B1)

Now I can just drag column B and then column C and cut and paste the numbers
into the gaps in my worksheet. Not very elegant I know, but it beats typing
each row manually!
 

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