DEC2OCT in WPS Spreadsheet: Create Octal Fields and Keep Decimal Totals Auditable
Encode decimal quantities as octal text in WPS Spreadsheet, compare padded and minimal fields and preserve the historical source’s incomplete boundary rules.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: DEC2OCT converts a decimal integer to an octal representation. =DEC2OCT(83,4) has independently expected text 0123. Omitting the optional width uses the minimum necessary characters.
Availability and version history
- Introduced: documented by 2019-05-06 in the official WPS lesson; the first release is not established.
- Availability: the lesson labels Windows Personal and explicitly demonstrates WPS 2019.
- 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 historical evidence
=DEC2OCT(number,[places])
The official May 6, 2019 Windows Personal lesson demonstrates WPS 2019. It defines an optional places argument, left-zero padding and ten-character, thirty-bit two’s-complement results for negatives, with places ignored for those negatives.
Several notes in that historical page are incomplete. Its range bullet stops after “if number”; another error sentence omits the width comparison. This guide therefore does not certify a decimal admission interval or exact insufficient-width error from those fragments. The worked values are modest integers, and the walkthrough explicitly explains that a field cannot use fewer characters than the converted value needs.
A thirty-bit signed model has mathematical capacity from −536870912 through 536870911. That describes the representation, not independently proven native acceptance at DEC2OCT’s endpoints.
Example 1: create an export field
Enter only the first numeric column in A2:A6. In B2 use =DEC2OCT(A2) and in C2 use =DEC2OCT(A2,4), filling both down.
| A, decimal quantity | B, minimal octal | C, four-character field |
|---|---|---|
| 0 | 0 | 0000 |
| 7 | 7 | 0007 |
| 28 | 34 | 0034 |
| 83 | 123 | 0123 |
| 511 | 777 | 0777 |
Octal 123 is 1×64+2×8+3=83. The extra leading zero adds field width without changing that quantity.
In D2 use =OCT2DEC(C2) and fill down. Expected numbers are 0, 7, 28, 83 and 511, matching A2:A6. OCT2DEC supplies a separate numeric inspection step.
Example 2: inspect signed negative output
| Formula | Independently expected octal |
|---|---|
=DEC2OCT(-1) |
7777777777 |
=DEC2OCT(-7) |
7777777771 |
=DEC2OCT(-83) |
7777777655 |
For −83, the thirty-bit unsigned encoding is 2^30−83=1073741741. Its ten octal digits are 7777777655; the signed decoder recovers −83.
A valid places value of four is ignored for these negatives under the formal definition. This does not resolve error precedence when places is itself invalid. The independently calculated ten-character outputs preserve a negative quantity rather than abbreviating it as the short positive suffix 655.
Advanced example: pack three octal digits deliberately
A fictional export record contains three fields, each restricted to integers zero through seven. Enter 2, 6 and 5 in F2:H2. In I2 calculate:
=F2*64+G2*8+H2
Expected quantity: 181. =DEC2OCT(I2,3) gives 265. A second record with fields 0, 1 and 3 gives quantity 11 and label 013.
A final field of eight is invalid for this layout. Fields 2,6,8 produce 184 and octal 270, carrying into the middle position. The converter cannot tell that the original field exceeded its permitted digit range. Validate components before packing.
Advanced example: add quantities before encoding
The quantities 28 and 83 total 111. =DEC2OCT(A4+A5,3) has expected octal text 157. The independent check is 1×64+5×8+7=111.
The visible octal labels 34 and 123 should not be treated as ordinary decimal quantities. Adding them as decimal numbers gives 157 by coincidence here, but that is not a general conversion method: octal 7 plus octal 1 must carry to 10, while ordinary decimal 7+1 gives the invalid octal digit 8.
Retain numeric sources and use SUM on those sources when totaling records. Encode the final quantity for the intended display or interface.
Width controls and source limits
The lesson states that fractional places is truncated. =DEC2OCT(83,4.9) therefore has expected field 0123. It also explicitly assigns #VALUE! to a nonnumeric number argument and #NUM! to negative places.
Its nonnumeric-places sentence incorrectly names the function instead of the argument, so that exact rule remains unresolved here. Number fractions, zero-width behavior, minimum/maximum acceptance and combined-error precedence are not inferred from Excel or from the mathematical encoding alone.
References and verification
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.