Function Problems

Fix Binary, Octal, and Hexadecimal Conversion Errors in Excel

Khadija KhanKhadija Khan Nov 22, 2026 868 views

Question details

The user needs to identify and correct errors when converting binary and octal values to hexadecimal and back in Excel.

Fix Binary, Octal, and Hexadecimal Conversion Errors 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.
Before you start

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.

Solution 1Recommended

Check the source digits and conversion formulas

Use this method when a round-trip conversion returns an unexpected value or an error.

1
Inspect the original value

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.

2
Correct missing digits

Compare the input cell with the original source. In the reported example, the intended octal value was 71111, not 7111.

3
Test the octal conversion

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.

4
Test the binary conversion

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.

5
Check function limits

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 the source digits and conversion formulas
Error types can vary: Invalid inputs or values outside a function's range may produce #NUM!, while an invalid argument can produce #VALUE!. Check the specific function and its arguments rather than relying on the error name alone.
Convert number bases in WPS

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. 1. Open the workbook: Launch WPS Office, open Spreadsheets, and use Open to select your Excel workbook.
  2. 2. Check the source cell: Select the cell containing the binary or octal input and inspect its digits in the formula bar.
  3. 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. 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.
Test OCT2HEX, HEX2OCT, BIN2HEX, and HEX2BIN formulasOpen and edit Microsoft Excel XLSX and XLS filesInspect source values and formulas in a familiar spreadsheet interface
microsoft office alternative - wps office

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.