Hi,
As the subject states, how do I add together cells containing hex numbers. I
tried
the following...
A1 contains 0f
a2 contains 0f
a3 contains = a1 a2
result #VALUE!
I know that it knows the cells could be hex because if I do =hex2dec(a1) in
another cell it converts it. Is there anyway in Excel to explicitly set the
number type of a cell?
Regards,
Dave.
As long as your numbers fit in that =hex2dec() and =dec2hex() ranges:
=DEC2HEX(HEX2DEC(A1) HEX2DEC(A2))
I don't know of anyway of using a custom format to display hex.
Dave wrote:
gt;
gt; Hi,
gt; As the subject states, how do I add together cells containing hex numbers. I
gt; tried
gt; the following...
gt;
gt; A1 contains 0f
gt; a2 contains 0f
gt; a3 contains = a1 a2
gt; result #VALUE!
gt;
gt; I know that it knows the cells could be hex because if I do =hex2dec(a1) in
gt; another cell it converts it. Is there anyway in Excel to explicitly set the
gt; number type of a cell?
gt;
gt; Regards,
gt; Dave.
--
Dave Peterson
You have nearly answered your own question:
=DEC2HEX(HEX2DEC(A1) HEX2DEC(A2))
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email
quot;Davequot; gt; wrote in message
...
gt; Hi,
gt; As the subject states, how do I add together cells containing hex numbers.
gt; I
gt; tried
gt; the following...
gt;
gt; A1 contains 0f
gt; a2 contains 0f
gt; a3 contains = a1 a2
gt; result #VALUE!
gt;
gt; I know that it knows the cells could be hex because if I do =hex2dec(a1)
gt; in
gt; another cell it converts it. Is there anyway in Excel to explicitly set
gt; the
gt; number type of a cell?
gt;
gt; Regards,
gt; Dave.
Thanks,
Thats what I did in the end. I just thought that with Excel being a big
number cruncher it would be a bit more flexible in the way you can use
numbers of a different base without having to jump through loops.
Regards,
Dave.
quot;Bernard Liengmequot; wrote:
gt; You have nearly answered your own question:
gt; =DEC2HEX(HEX2DEC(A1) HEX2DEC(A2))
gt;
gt; --
gt; Bernard V Liengme
gt; www.stfx.ca/people/bliengme
gt; remove caps from email
gt;
gt; quot;Davequot; gt; wrote in message
gt; ...
gt; gt; Hi,
gt; gt; As the subject states, how do I add together cells containing hex numbers.
gt; gt; I
gt; gt; tried
gt; gt; the following...
gt; gt;
gt; gt; A1 contains 0f
gt; gt; a2 contains 0f
gt; gt; a3 contains = a1 a2
gt; gt; result #VALUE!
gt; gt;
gt; gt; I know that it knows the cells could be hex because if I do =hex2dec(a1)
gt; gt; in
gt; gt; another cell it converts it. Is there anyway in Excel to explicitly set
gt; gt; the
gt; gt; number type of a cell?
gt; gt;
gt; gt; Regards,
gt; gt; Dave.
gt;
gt;
gt;
- Jul 16 Mon 2007 20:38
adding hexadecimal numbers
close
全站熱搜
留言列表
發表留言