Excel – how can I convert HEX numbers into Text in Excel 2007

hexadecimalmicrosoft excel

I have one column (A) with decimal numbers
A second column currently has this function: =DEC2HEX(A1)
The second column currently shows the hex equivalent of the decimal number e.g. 14=E
I wish the second column to show "0xE" as it would in Visual Studio
I have tried ="0x"+DEC2HEX(A1)
and also ="0x"+TEXT(DEC2HEX(A1),"00")
but neither work.
How can I do this please?

Best Answer

Use & to concatenate text.

="0x"&DEC2HEX(A1)
Related Question