Is there a cell format for HEX numbers?

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
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?
 
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
 
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!
 
Back
Top