Zoho Sheet DEC2OCT Function: Decimal to Octal with Examples
Convert decimal values to octal in Zoho Sheet with exact datasets, place-value checks, documented limits and practical examples.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
DEC2OCT converts a decimal representation into octal. For the positive integer 42, the source numeral is 42 and the converted result is 52. The base changes; the represented quantity does not. Use a width argument when a receiving report needs leading zeroes.
Syntax and availability
DEC2OCT(decimal_number; digits)
Zoho’s official DEC2OCT entry was checked on October 15, 2026. It describes the rolling web service. The first supported release and last functioning version are unknown; current documentation is separate from those historical endpoints. Mobile/offline parity is unverified. Results below are independent integer calculations, not native Zoho execution.
The required numeric input has documented inclusive bounds −2^29 through 2^29−1, or −536,870,912 through 536,870,911. These are numeric bounds, not a limit of ten decimal digits. The worksheet below deliberately uses positive integers. Although the help includes a fractional argument illustration and a negative-looking output, it does not fully explain fractional rounding or signed output encoding; neither is inferred here.
The second argument chooses the output width. When the representation is shorter, Zoho pads its left side with zeroes; an insufficient width is an error, not permission to cut off significant digits. Use positive integer widths here. Fractional widths, blank inputs and Boolean coercion are not verified.
The official syntax shows digits without optional brackets, but its own examples omit this argument. The worksheet uses an explicit width, avoiding that documentation inconsistency. The description labels the same second position num_of_digits.
Rebuild a width example with an explicit input
The help displays a twelve-character result from an unspecified cell reference. With an independently specified integer input, =DEC2OCT(478;12) has expected result 000000000736. This agrees with the displayed representation, but does not establish what was in the vendor’s hidden input cell or how a fractional value would be coerced. Twelve-character padding is explicitly illustrated by Zoho.
Complete reproducible worksheet
Create Conversions with Source in A1, Decimal_check in B1, Converted in C1, and Padded in D1. Enter the following values in A2:B7. Enter the source numerals exactly as shown, without grouping commas or base prefixes. Column B is an independent explanatory value, not an argument to the conversion formula.
| Row | A: source | B: decimal check | C: expected | D: expected width 5 |
|---|---|---|---|---|
| 2 | 1 | 1 | 1 | 00001 |
| 3 | 7 | 7 | 7 | 00007 |
| 4 | 15 | 15 | 17 | 00017 |
| 5 | 42 | 42 | 52 | 00052 |
| 6 | 63 | 63 | 77 | 00077 |
| 7 | 255 | 255 | 377 | 00377 |
In C2:C7 use widths 1,1,2,2,2,3, respectively: C2 is =DEC2OCT(A2;1), C3 is =DEC2OCT(A3;1), C4 is =DEC2OCT(A4;2), C5 is =DEC2OCT(A5;2), C6 is =DEC2OCT(A6;2) and C7 is =DEC2OCT(A7;3). These widths expose the significant digits without relying on the inconsistent optional-argument notation.
Fill D2 =DEC2OCT(A2;5) through D7. The zeroes in D belong to the representation, not to a larger numeric value.
In a copy change A5 from 42 to 43 and update its explanatory B5 to 43. C5 becomes 53 and D5 becomes 00053. Other records remain unchanged. This gives a one-unit sensitivity check with a fully specified input.
Advanced: audit an octal counter boundary
Put 511,512,513 in G2:G4. Fill H2 =DEC2OCT(G2;4) through H4. The expected strings are 0777,1000,1001. Each input increases by one, but the first step carries across every existing octal position. It does not represent a jump of 223 decimal units.
The boundary follows from 7×64+7×8+7=511 and 1×512=512. A three-character width can hold 777 but cannot hold 1000, so specifying width three for 512 invokes the documented insufficient-width error rather than truncating a digit. Choose width from the largest allowed value in the source system, not merely from the first record.
For another control, =DEC2OCT(341;4) has expected result 0525, because 5×64+2×8+5=341. An octal output ending in 5 is not proof that its input is divisible by five. Divisibility, averages and totals belong in the original decimal numeric column, while the octal column is the representation used by the receiving specification.
Errors and troubleshooting
The documented #NUM! cases include an output that needs more places than the requested width, and width zero or negative. For example, =DEC2OCT(255;1) cannot hold 377 in one position. Increasing the width preserves the whole representation; shortening the source value would change the data.
Inputs outside the documented numeric interval also produce #NUM!. The upper bound plus one, 536,870,912, is outside that interval. Do not remove an error merely to make a report appear complete: retain the raw value and investigate the format or width rule.
The shared help glossary mentions name, type and reference errors without defining a complete coercion matrix for this function. Check the source base, legal characters, cell type and literal quotation before investigating more complex formulas. Do not add 0x, 0b or other programming-language prefixes unless a product reference explicitly permits them.
Keep conversion and arithmetic separate. A nondecimal display can look like a decimal number, yet ordinary subtraction on that display need not measure the intended change. Preserve raw identifiers, document the source’s sign and width convention, and verify exported leading zeroes in the receiving system. Matching function names across spreadsheet products do not establish identical limits or behavior.