Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
hex2dec
I need to convert a list of 16 bit hex values to decimal. The list contains
both positive and negative numbers. hex2dec works for a 10 digit but for anything less the number appears to be padded with zeros and doesn't come out negative as it should. Example, 0xFFE6 comes out 65510 instead of -26(correct) Is there a fix for this? The list is very long. thanks, tim |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
hex2dec
"twilkers" wrote:
hex2dec works for a 10 digit but for anything less the number appears to be padded with zeros and doesn't come out negative as it should. Example, 0xFFE6 comes out 65510 instead of -26(correct) One way: =HEX2DEC(A1) - 65536*AND(LEN(A1)=4,HEX2DEC(LEFT(A1,1))=8) ----- original message ----- "twilkers" wrote in message ... I need to convert a list of 16 bit hex values to decimal. The list contains both positive and negative numbers. hex2dec works for a 10 digit but for anything less the number appears to be padded with zeros and doesn't come out negative as it should. Example, 0xFFE6 comes out 65510 instead of -26(correct) Is there a fix for this? The list is very long. thanks, tim |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
hex2dec
PS....
More straight-forward: =HEX2DEC(A1) - 65536*(HEX2DEC(A1)32767) ----- original message ----- "JoeU2004" wrote in message ... "twilkers" wrote: hex2dec works for a 10 digit but for anything less the number appears to be padded with zeros and doesn't come out negative as it should. Example, 0xFFE6 comes out 65510 instead of -26(correct) One way: =HEX2DEC(A1) - 65536*AND(LEN(A1)=4,HEX2DEC(LEFT(A1,1))=8) ----- original message ----- "twilkers" wrote in message ... I need to convert a list of 16 bit hex values to decimal. The list contains both positive and negative numbers. hex2dec works for a 10 digit but for anything less the number appears to be padded with zeros and doesn't come out negative as it should. Example, 0xFFE6 comes out 65510 instead of -26(correct) Is there a fix for this? The list is very long. thanks, tim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I 'Add-In' Hex2Dec formula? | Excel Worksheet Functions | |||
Hex2Dec substitue? | Excel Discussion (Misc queries) | |||
Can I use HEX2DEC with cell references vs. numbers? | Excel Worksheet Functions | |||
EXCEL HEX2DEC conversion error | Excel Worksheet Functions |