Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Converting to Hexadecimal.
by Allen Wyatt
(last updated June 14, 2018)
If you do any programming, you know how important hexadecimal numbers are. Hexadecimal numbers are used to represent values that can be easily understood by both humans and programming languages. In the hexadecimal numbering system, each digit can vary between 0 and F. Thus, 0 through 9 are the same as in our decimal numbering system, and A through F are converted to 10 through 15 in decimal.
How can Excel help with hexadecimal numbers? It includes a worksheet function that allows you to easily convert a number from decimal to hexadecimal. For instance, let's say you have a decimal value in E3. If you wanted to know the hexadecimal equivalent, you would use the following:
If the value in E3 was 123, the result of the above formula would be 7B. The DEC2HEX worksheet function can be used to convert any decimal values between -549,755,813,888 and 549,755,813,887.
Once the conversion is done, the value in the cell is considered text. This means that you cannot use the results of DEC2HEX in a numeric formula.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12384) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Converting to Hexadecimal.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
If you need to insert into a cell the name of the workbook in which a worksheet is contained, you can use the CELL ...Discover More
Users of the most recent versions of Excel have four different ways available to combine values into strings. Even those ...Discover More
Excel allows you to easily develop formulas that pull values from worksheets and workbooks other than the one in which ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.