Software developers and electrical engineers: Need to convert numbers in your Microsoft Excel 2003 spreadsheet between the standard (decimal - base 10) and these numbering systems?
* Binary (base 2) 0-1
* Octal (base 8) 0-7
* Hexadecimal (base 16) 0-F
The following formulas will do the trick. Note you must install the Analysis ToolPak Add-In for these functions to work.
=DEC2BIN: Convert decimal number to binary
=DEC2OCT: Convert decimal numbers to octal
=DEC2HEX: Convert decimal numbers to hexadecimal
=BIN2DEC: Convert binary number to decimal
=BIN2OCT: Convert binary numbers to octal
=BIN2HEX: Convert binary numbers to hexadecimal
=OCT2BIN: Convert octal numbers to binary
=OCT2DEC: Convert octal number to decimal
=OCT2HEX: Convert octal numbers to hexadecimal
=HEX2DEC: Convert hexadecimal number to decimal
=HEX2BIN: Convert hexadecimal numbers to binary
=HEX2OCT: Convert hexadecimal numbers to octal
Note that invalid numbers may result in the cell displaying #NUM!.
Here are some examples:
=DEC2BIN(64)
1000000
=BIN2OCT(0111)
7
=OCT2HEX(17)
F
=HEX2DEC("CAB")
3243
Note: As shown by the last example, when converting hexadecimal numbers that include A-F, you should surround the number with quotes, otherwise Microsoft Excel 2003 may display #NAME? in the cell.
Press the "print" button on your browser or select "File" - "Print" to print this tip. Then, return to Microsoft Excel 2003 Functions and Formulas - Switching Between Numbering Systems.
Standard disclaimer applies - Read http://tipsforspreadsheets.com/copyright-disclaim.html.