Excel – How to convert a hex number to a decimal number in Excel

conversionhexadecimalmicrosoft excel

I have a cell containing this value:

0x00006cd2c0306953

and I want to convert it to a number.

I tried:

=HEX2DEC(C8)

where C8 is the cell containing my hex value.

I get a #NUM error.

What am I doing wrong?

Best Answer

You could simply use:

HEX2DEC(right(A1,(len(A1)-2)))

len(A1) gives you the length of 0x string. Exclude the length of 0x, the remaining string is the hex number. Use Excel function to get the dec.

Related Question