HEX

G

Guest

I want to be able to enter numbers into an Excel column in
Hexadecimal; both type them in as HEX and import and export them
from other software applications and have them appear as HEX.

How can you tell is data is formated in HEX?

Is there a way to click on a cell and tell what kind of
data is in the cell (I.E. Number, Text, Date, Currency et
cetera. . .)?

I was wanting to be able to enter (Type in) a HEX number
directly into a cell, and have it obvious to everyone what
kind of data it is.

I was wanting all the numbers in a column to be interpreted
as HEX numbers; not for some to be LEFT justified (Those that
don't have an A, B, C, D, E or F digit as part of the number),
and for some to be RIGHT justified (Those that do have an A, B,
C, D, E or F digit as part of the number).

If I select a column, use the FORMAT pull-down menu and
select CELLS, the NUMBER tab and NUMBER, when I enter the hex
numbers some are right justified, some are left justified:
15B3
5555
15C3
1234


I also played around with the conversion ToolPak. It seems
that when I use the =DEC2HEX(number) function in the function
bar, the result is always left justified (Just like text is).
So is the output of this =DEC2HEX function text or a number?

For example


1. On the Tools menu, click Add-Ins.
2. In the Add-Ins available list, select the Analysis
ToolPak box, and then click OK.

I have already done this.

In the fx formula bar if you type =DEC2HEX(5555) in the
cell it will convert the decimal number 5555 to 15B3 and it will
be left justified in the cell; [I am use to seeing numbers
right justified in the cell].

If I type 21845 in a cell, and in the fx formula bar I
type =DEC2HEX(21845)the resulting number in the cell will be
5555, and it will be left justified.

15B3
15B4
15B4
5555

=DEC2HEX(5555)
=DEC2HEX(5556)
=DEC2HEX(5556)
=DEC2HEX(21845)

I guess I can force the alignment by select Format, Cell, Alignment.

Is this a clear regarding what I am asking for?

Larry Oliveto
350 Lowell Street ANMA11
Andover, Massachusetts 01810
 
D

David McRitchie

Hi Larry,
I think you are trying to get a typing of data such as in C++ out of Excel, and
if that is the case you are out of luck. I've never worked with any C
programming language anyway.

The HEX representation is text so anything resulting in a conversion to
hex representation would be text. which is left aligned.

When you type in HEX there can be no assumption as to what kind
of data that it is supposed to represent. It represents bits.

As to what you have:
You might look at the Worksheet Functions to determine the actual data
content of another cell: ISNUMBER, ISTEXT, LEN, ISBLANK, CODE,
http://www.mvps.org/dmcritchie/excel/join.htm#debugformat

You might also take a look at GetFormula, GetFormat
http://www.mvps.org/dmcritchie/excel/formula.htm


Larry said:
I want to be able to enter numbers into an Excel column in
Hexadecimal; both type them in as HEX and import and export them
from other software applications and have them appear as HEX.

How can you tell is data is formated in HEX?

Is there a way to click on a cell and tell what kind of
data is in the cell (I.E. Number, Text, Date, Currency et
cetera. . .)?

I was wanting to be able to enter (Type in) a HEX number
directly into a cell, and have it obvious to everyone what
kind of data it is.

I was wanting all the numbers in a column to be interpreted
as HEX numbers; not for some to be LEFT justified (Those that
don't have an A, B, C, D, E or F digit as part of the number),
and for some to be RIGHT justified (Those that do have an A, B,
C, D, E or F digit as part of the number).

If I select a column, use the FORMAT pull-down menu and
select CELLS, the NUMBER tab and NUMBER, when I enter the hex
numbers some are right justified, some are left justified:
15B3
5555
15C3
1234


I also played around with the conversion ToolPak. It seems
that when I use the =DEC2HEX(number) function in the function
bar, the result is always left justified (Just like text is).
So is the output of this =DEC2HEX function text or a number?

For example


1. On the Tools menu, click Add-Ins.
2. In the Add-Ins available list, select the Analysis
ToolPak box, and then click OK.

I have already done this.

In the fx formula bar if you type =DEC2HEX(5555) in the
cell it will convert the decimal number 5555 to 15B3 and it will
be left justified in the cell; [I am use to seeing numbers
right justified in the cell].

If I type 21845 in a cell, and in the fx formula bar I
type =DEC2HEX(21845)the resulting number in the cell will be
5555, and it will be left justified.

15B3
15B4
15B4
5555

=DEC2HEX(5555)
=DEC2HEX(5556)
=DEC2HEX(5556)
=DEC2HEX(21845)

I guess I can force the alignment by select Format, Cell, Alignment.

Is this a clear regarding what I am asking for?

Larry Oliveto
350 Lowell Street ANMA11
Andover, Massachusetts 01810
 

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