Contact

DEC2OCT Function in ONLYOFFICE Spreadsheet Editor: Syntax and Worked Examples

Engineering Beginner ONLYOFFICE Spreadsheet Editor

Convert nonnegative base-10 whole numbers into base-8 numerals, retain output width, and investigate documented errors without guessing native behavior.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked

Quick answer

Convert Decimal Integers to Octal. Many engineering readers think octal 10 means ten decimal units; it instead means eight. This guide deliberately puts decimal input alongside base-eight output. The exact English-reference syntax is =DEC2OCT(number, [places]), documented by the official ONLYOFFICE DEC2OCT function article (checked 2026-10-13 UTC). A value of 65 in decimal is 101 in octal because 1×64+0×8+1=65. A fixed six-character display is 000101, representing the same integer, not a larger one.

Verification: Results are independently calculated mathematical expectations. Native ONLYOFFICE Docs web or Desktop execution, localized parsing and runtime error capture were not performed.

Purpose, context and when to use DEC2OCT

DEC2OCT takes a decimal integer and writes its equivalent base-eight representation. Octal uses only digits 0–7. It is useful for reading legacy permission masks, debugging base-eight labels, and teaching positional notation; it does not turn measurements or fractions into another unit.

What the notation means

  • Decimal/base 10: each digit’s value is weighted by powers of 10.
  • Octal/base 8: valid digits are 0–7, weighted by powers of 8.
  • Hexadecimal/base 16: digits are 0–9 and letters A–F (A=10 through F=15), weighted by powers of 16.
  • A base conversion preserves the integer. Zero padding with places (when supported) changes the output’s character count, not the represented quantity.

For a cell containing an octal or hexadecimal identifier, format it as Text before typing any leading zeros. Literal strings in the formulas are wrapped in double quotation marks, e.g. "377" rather than a bare number assumed to be octal. The underlying reference does not exhaustively specify every numeric-to-text coercion; check the stored cell type when recreating this worksheet.

Exact documented syntax, arguments and defaults

=DEC2OCT(number, [places])
Argument position Argument Requirement and type Meaning / documented default
1 number Required A decimal number, entered directly or referenced from a cell; this guide uses nonnegative integers for independently calculable examples.
2 places Optional numeric width Desired count of octal digits (numeric); optional, and omitting it requests the shortest output according to the official reference. If places is omitted, use the minimum number of digits.

The square brackets around places (when present) mean optional, not literal square brackets to enter in the cell. The vendor reference orders the arguments exactly as printed above; swapping them changes the meaning. See the vendor’s documented syntax and notes.

Reproducible worksheet: from source input to expected output

  1. In a new, otherwise empty worksheet, enter Scenario in A1 and Decimal quantity in B1. Enter Places in C1, Minimum output in D1 and Padded output in E1.
  2. Enter the nonnegative decimal integers as ordinary Number values in B2:B21. For reproducibility, enter the B-column source values from the rows below without the article’s backtick punctuation.
  3. Enter 6 as the numeric Places setting in C2:C21. Put =DEC2OCT(B2) into D2, and =DEC2OCT(B2,C2) into E2; copy each formula down to row 21.
  4. Compare the spreadsheet outputs to the independent expectations. If your installation differs, note the software edition and version, formula language, region, source cell type and entered formula. An expected result is not a claimed live test.
  5. Save the workbook with its sample values so a reviewer can repeat the comparison. To inspect a hidden leading zero, click the source cell and check the formula bar as well as the displayed cell.

Input and expected-output worksheet

Row Use case B: source C: places D: Expected octal (minimum) E: Expected octal (6 places) Decimal cross-check
2 Zero 0 6 0 000000 0
3 One 1 6 1 000001 1
4 Last single octal digit 7 6 7 000007 7
5 Octal carry 8 6 10 000010 8
6 After carry 9 6 11 000011 9
7 Low nibble 15 6 17 000017 15
8 Second octal digit 16 6 20 000020 16
9 Five-bit value 31 6 37 000037 31
10 Power of two 32 6 40 000040 32
11 Six-bit maximum 63 6 77 000077 63
12 Eight squared: 64 64 6 100 000100 64
13 ASCII A magnitude 65 6 101 000101 65
14 Small permission total 75 6 113 000113 75
15 Example of 83 83 6 123 000123 83
16 Seven-bit maximum 127 6 177 000177 127
17 Eighth bit 128 6 200 000200 128
18 Full byte 255 6 377 000377 255
19 First two octal blocks 256 6 400 000400 256
20 12-bit maximum 4095 6 7777 007777 4095
21 16-bit maximum 65535 6 177777 177777 65535

Independent calculation method: Parse the input numeral in its stated source radix using exact integer arithmetic, then format that same integer in the destination radix. For the fixed-width column, left-pad the resulting string with the digit 0 to the requested width. These computations were checked with a separate Python integer conversion routine. That routine is not an ONLYOFFICE interpreter; outputs and text handling must still be verified in an installed editor.

Direct formulas to paste in an empty cell

Formula Expected output (independent) Decimal cross-check
=DEC2OCT(8) 10 8
=DEC2OCT(15) 17 15
=DEC2OCT(75) 113 75
=DEC2OCT(83) 123 83
=DEC2OCT(165) 245 165
=DEC2OCT(255) 377 255
=DEC2OCT(4095) 7777 4095
=DEC2OCT(65535) 177777 65535
=DEC2OCT(15,6) 000017 15
=DEC2OCT(83,6) 000123 83
=DEC2OCT(255,6) 000377 255
=DEC2OCT(65535,6) 177777 65535

Reproducibility note: Quoted numeral literals keep the source notation intact. Results that look like text codes should not be coerced to ordinary decimals when copied into another program. To preserve fixed-width output, ensure destination cells have appropriate formatting before downstream use; the exact returned cell type is a native-test question.

Advanced uses and worked applications

1. Byte audit

DEC2OCT takes a decimal integer and writes its equivalent base-eight representation. For this application enter =DEC2OCT(255); the independently expected result is 377. 255 = 3×64 + 7×8 + 7, hence octal 377. This is a useful bridge when a byte 0–255 is shown in base eight.

2. Permission digits

DEC2OCT takes a decimal integer and writes its equivalent base-eight representation. For this application enter =DEC2OCT(75); the independently expected result is 113. 75 decimal is 113 octal: 1×64+1×8+3. Do not confuse an octal permissions label (e.g., 755) with a decimal count.

3. Power-of-eight transition

DEC2OCT takes a decimal integer and writes its equivalent base-eight representation. For this application enter =DEC2OCT(64); the independently expected result is 100. 64 decimal becomes octal 100; 77 octal represents only 63 decimal.

4. Larger label

DEC2OCT takes a decimal integer and writes its equivalent base-eight representation. For this application enter =DEC2OCT(4095); the independently expected result is 7777. 4095 decimal becomes octal 7777, illustrating four full octal digits.

5. Cross-base confirmation without rounding

=DEC2OCT(HEX2DEC("FF")) → 377; =DEC2OCT(BIN2DEC("11111111"),6) → 000377 (mathematical expected values). These are independent compositions of documented functions, not formulas executed in ONLYOFFICE. Round-tripping is an excellent future desktop/web test, because it simultaneously probes coercion, function availability, and output text formatting. It is not evidence of behavior in any particular version.

6. Formula portability and identifiers

If using DEC2OCT for imported device codes, keep the original string and the converted string in separate columns. Add another column with the original base (8, 10 or 16) so downstream consumers do not interpret octal 377 as decimal 377. Retain the raw source when leading zeros or digit count carry meaning outside mathematics (for instance, a fixed-width external identifier).

Documented errors and troubleshooting

Only the rules explicitly attributed to the official DEC2OCT article are treated as vendor-established; the following error cases were not triggered in an actual ONLYOFFICE editor.

Formula Vendor-documented error category (not natively observed) Diagnosis
=DEC2OCT(10,0) #NUM! Official documented places rule: zero is not positive.
=DEC2OCT(10,-2) #NUM! Official documented places rule: a negative width is invalid.

Source-rule summary

  • places less than or equal to zero produces #NUM! according to the official DEC2OCT reference.

Do not assume an outcome without checking the actual installed edition

  • The checked DEC2OCT page does not supply a decimal input range or describe signed, fraction, nonnumeric, or overly narrow positive places behavior. Do not borrow those limits from Excel.
  • The representation of negative integers (including any fixed-width sign extension) and the precise output cell type need tests in the target ONLYOFFICE version.

Practical troubleshooting sequence

  1. Verify the function name and argument count exactly against the official page. A one-argument-only function cannot take a width parameter.
  2. Verify the input base: octal uses 0–7; hexadecimal uses 0–9 and A–F; decimal is base 10. An apparently numeric cell might not contain the intended numeral representation.
  3. If a leading zero matters, change the source cell to Text before re-entering the value. Verify the formula bar retains it.
  4. If the function has places, first omit it to establish the shortest expected output mathematically; then enter a positive integer large enough for that output. A width counts characters, not bits or decimal places.
  5. For an unexpected error, record the exact formula, source type, locale and app version; inspect the vendor’s documented error rules before attributing it to a specific behavior.
  6. If passing values between multiple conversion functions, inspect whether the intermediate result is textual or numeric in that exact editor. Do not conclude success merely because formatting makes a number look plausible.

Cases requiring native compatibility checks

  • =DEC2OCT(-1) and =DEC2OCT(-1,6) (signed semantics not documented on this page).
  • =DEC2OCT(9,1) and =DEC2OCT(9,2) (one octal digit is too narrow; official page does not specify the exact resulting error).
  • =DEC2OCT(8.9) (non-integer behavior unknown).
  • =DEC2OCT("8") versus =DEC2OCT(8) (text-to-number coercion unknown).

Platform, locale and release-specific cautions

This is documentation-based research for ONLYOFFICE Spreadsheet Editor, not a general Excel guide. The current function catalogue lists the function under Engineering; the English Insert Functions instructions show formulas beginning with = and (in their example grammar) comma-separated arguments. The ONLYOFFICE Advanced Settings help documents selectable formula languages and regional options. In other language/region setups, verify the localized function label, argument separator and decimal settings in the editor before pasting the English formula; no localized syntax was executed here.

Docs web vs Desktop Editors: ONLYOFFICE maintains Docs release notes separately from Desktop Editors release notes. The functions’ current online help is an unversioned reference, not a support matrix. Docs 10.0.0 is listed in its changelog dated 2026-10-10, while the Desktop changelog reviewed on 2026-10-13 has a separate version history. Neither checked changelog establishes a first-supported version for this specific base-conversion function. Accordingly, treat older Desktop, web installations and external file imports as not natively verified. No native execution, screenshot, runtime error capture, or edition-to-edition compatibility testing was performed for this manuscript.

The following links lead to official vendor references checked on 2026-10-13 UTC.

Verification and limitations

Check Status
Official DEC2OCT syntax, argument order and documented default Documentation-checked, 2026-10-13 UTC
Official error/length behavior Documentation-checked only for the rules stated above
Independent exact-integer examples Validated with a separate calculation, not native ONLYOFFICE
ALL native Desktop/web execution tests Not performed
Locale-specific syntax, exact runtime error captures, signed limit behavior Unverified
Old release capability and first-supported web/Desktop edition Not established

For any native compatibility check, record the edition, version, operating system/browser, formula language, region, source-cell type and actual observed output.