Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like a format a cell in Microsoft Excel 2007 in hexadecimal but am not finding how to do this.

Is there a built-in way to change the base from 10 to 16 for a cell?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

If you want to format a cell so that you can type in a decimal number and automatically have it displayed as a hexadecimal number, then that's not possible. You can either format the cell as text and enter hexadecimal numbers directly (but note that Excel cannot use those for calculations), or use the DEC2HEX() and HEX2DEC() functions to convert between base 10 and base 16.

share|improve this answer

If cell to be converted is A1 use =DEC2HEX(A1).

share|improve this answer

If you need to perform mathematical operations on numbers converted to hex, first convert them to decimal, perform the operation, then convert back to hex.

For example, if cell A1 has a hex number, such as would be created from this formula:

=DEC2HEX(17)

which would be displayed as 11, and cell A2 has formula:

=DEC2HEX(165)

which would be displayed as A5, and you want to add them together, then this formula would get the desired result:

=DEC2HEX(HEX2DEC(A1)+HEX2DEC(A2))

which would be displayed as B6

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.