OCT2HEX in WPS Spreadsheet: Translate Octal Records and Preserve Negative Sign Extension
Convert octal strings to hexadecimal in WPS Spreadsheet, verify positive padding and distinguish whole-quantity conversion from digitwise field replacement.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: OCT2HEX converts an octal representation to hexadecimal text. =OCT2HEX("245",4) has independently expected output 00A5, representing 165. Negative inputs use the lesson’s documented ten-character hexadecimal result.
Availability and version history
- Introduced: documented by 2019-06-24 in the official WPS lesson; the first release is not established.
- Availability: Current WPS Windows documentation confirms this function. The historical lesson’s edition field is blank.
- Scope: exact current supported builds and other WPS clients remain unverified.
- Checked: October 14, 2026. Documentation and independent calculations; no native WPS execution.
Syntax and output width
=OCT2HEX(number,[places])
The official WPS lesson allows at most ten octal input characters, spanning thirty bits, with a two’s-complement negative convention. Places is optional: omission uses the minimum necessary character count and a larger supplied width adds leading zeros.
For a negative quantity, places is ignored and the output contains ten hexadecimal characters, or forty bits. The conversion preserves the signed value while extending its representation to a different width.
The historical edition field is blank. A separate current Windows introduction confirms the product’s OCT2HEX identity without assigning a first release or a precise supported-build range.
Example 1: convert a fixed-width input column
Enter only the first column as Text in A2:A6. Put =OCT2HEX(A2) in B2 and =OCT2HEX(A2,4) in C2, then fill down.
| A, octal text | B, minimum hex | C, width four |
|---|---|---|
| 005 | 5 | 0005 |
| 045 | 25 | 0025 |
| 111 | 49 | 0049 |
| 245 | A5 | 00A5 |
| 454 | 12C | 012C |
The independently decoded quantities are 5, 37, 73, 165 and 300. For octal 111, 64+8+1=73; hex 49 gives 4×16+9=73.
The strings 045 and 0025 have different lengths and bases but the same quantity. A conversion cannot retain the original leading-zero count unless you store the original text or its layout separately.
Example 2: verify both sides numerically
In D2 enter =OCT2DEC(A2) and in E2 enter =HEX2DEC(C2), filling both through row 6. Expected values agree row by row: 5, 37, 73, 165 and 300.
OCT2DEC interprets the source base; HEX2DEC interprets the target. Keeping both helper columns makes a conversion audit easier to reproduce than comparing strings with different alphabets and widths.
For 165, the octal expansion is 2×64+4×8+5 and the hex expansion is 10×16+5. Each independently produces 165.
Advanced example: preserve negative sign extension
| Octal input | Signed value | Expected hex |
|---|---|---|
| 7777777777 | -1 | FFFFFFFFFF |
| 7777777773 | -5 | FFFFFFFFFB |
| 7777777400 | -256 | FFFFFFFF00 |
| 4000000000 | -536870912 | FFE0000000 |
For −5, the source unsigned pattern is 1073741819 and the target unsigned pattern is 1099511627771. Subtracting the corresponding 2^30 or 2^40 modulus recovers −5 on either side.
Unsigned grouping of octal 7777777777 would instead produce hex 3FFFFFFF, or positive 1073741823. That would change the sign and quantity rather than perform the documented signed conversion.
A valid places value of 4 does not shorten the negative output. Invalid-width interactions remain unverified; use the clear valid examples when checking a specific WPS build.
Advanced check: digitwise conversion changes positional weights
Octal 245 represents 165, and the whole conversion produces hex A5. If its separate digits 2, 4 and 5 are independently converted to one-character hex and concatenated, the resulting text is 245.
But hexadecimal 245 represents 2×256+4×16+5=581. The values of the individual digits did not change; their positional weights did.
If the source really contains three independent fields, retain their separate meanings and boundaries. If it is one quantity, convert the complete string. LEFT, MID and RIGHT can select declared fields but cannot decide that data-model question.
Reverse conversion and padding errors
For the positive source 245, =HEX2OCT(OCT2HEX("245",4),3) has independently expected text 245. HEX2OCT has a narrower target interval than the complete hex representation, so this round-trip is deliberately scoped to a value that fits.
The OCT2HEX lesson explicitly documents #NUM! for invalid octal input or insufficient places, truncation of fractional places, #VALUE! for nonnumeric places and #NUM! for negative places.
Octal 454 needs three hex digits, so =OCT2HEX("454",2) follows the insufficient-width rule. Places 4.9 truncates to 4 and gives 012C. Zero places, prefix cleanup, extra-long-input error details and competing-error precedence remain unverified. The tutorial’s results are independently calculated, not captured native application outputs.
References and verification
- WPS Academy: OCT2HEX, 2019-06-24 (Chinese).
- Current WPS Windows OCT2HEX introduction.
- Editorial testing standards.
Complete function-specific documentation reviewed. Worked outputs are independently calculated expectations, not captured native results. Formulas use English names and comma separators; check the installed locale. Product/client and source gaps retain their explicit scope.