Fix Binary, Octal, and Hexadecimal Conversion Errors in Excel
Question details
The user needs to identify and correct errors when converting binary and octal values to hexadecimal and back in Excel.

- Product
- Microsoft Excel
- Device & OS
- Laptop; OS not provided
- Scenario
- A workbook converts binary or octal inputs to hexadecimal and then reverses the conversions.
- Observed behavior
- Some conversions return incorrect values or #VALUE! errors.
Locate the original input cells and the formulas used for each conversion. Check which Office language and regional settings are active, especially if the workbook was created on another computer.
Check the source digits and conversion formulas
Use this method when a round-trip conversion returns an unexpected value or an error.
Select the input cell in Excel and check its contents in the formula bar. Binary inputs can contain only 0 and 1; octal inputs can contain only digits 0 through 7; hexadecimal inputs can contain digits 0 through 9 and letters A through F.
Compare the input cell with the original source. In the reported example, the intended octal value was 71111, not 7111.
In an empty cell, enter =OCT2HEX("71111") and confirm that the result is 7249. In another cell, enter =HEX2OCT("7249") to confirm that it returns 71111.
In empty cells, enter =BIN2HEX("111") and =HEX2BIN("7"). The results should be 7 and 111, respectively. Compare these functions with the formulas in your workbook.
Select each conversion formula and check its input and any optional places argument. Excel's base-conversion functions have length and range limits; for example, HEX2BIN cannot return a positive value greater than 511.

Check Excel language and regional settings
Use this check if the same workbook behaves differently across computers or Office languages.
Check Number Base Conversions in WPS Spreadsheets
Open the workbook in WPS Spreadsheets and test its binary, octal, and hexadecimal conversion formulas against known values.
- 1. Open the workbook: Launch WPS Office, open Spreadsheets, and use Open to select your Excel workbook.
- 2. Check the source cell: Select the cell containing the binary or octal input and inspect its digits in the formula bar.
- 3. Test an octal conversion: Enter =OCT2HEX("71111") in an empty cell and check that it returns 7249. Enter =HEX2OCT("7249") in another cell to test the reverse conversion.
- 4. Correct and save: Edit any incorrect input or formula, then use File > Save As to save the updated workbook in your preferred Excel format.

Frequently Asked Questions
What should OCT2HEX return for the octal value 71111?
In Excel, =OCT2HEX("71111") returns 7249. If the source is 7111 instead, the result is E49.
Why does my conversion formula return an error?
Check the source cell for invalid digits, missing digits, or a value outside the function's supported range. Also inspect any optional places argument; depending on the issue, Excel may return #NUM! or #VALUE!.
Why can't HEX2BIN convert every hexadecimal value?
HEX2BIN has a limited output range: its positive result cannot exceed 511. Check the hexadecimal input against that limit before using the function.
Can an Office language setting change the conversion result?
The mathematical result should not change, but localized function names and regional formula separators can affect how a formula is entered. Check File > Options > Language and your regional settings if a formula works on one computer but not another.




