Engineering functions

DEC2OCT

Matches all 4,811 recorded answers

Recorded: 4,807 in the answer bank and 4 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicDEC2OCT
BulgarianDEC2OCT
CzechDEC2OCT
DanishDEC.TIL.OKT
GermanDEC2OCT
GreekDEC2OCT
English (Australia)DEC2OCT
English (United Kingdom)DEC2OCT
English (United States)DEC2OCT
SpanishDEC.A.OCT
EstonianDEC2OCT
FinnishDESOKT
FrenchDECOCT
HebrewDEC2OCT
CroatianDEC2OCT
HungarianDEC.OKT
IndonesianDEC2OCT
ItalianDEC2OCT
JapaneseDEC2OCT
KoreanDEC2OCT
LithuanianDEC2OCT
LatvianDEC2OCT
NorwegianDEC2OCT
DutchDEC.N.OCT
PolishDZIES.NA.ÓSM
Portuguese (Brazil)DEC2OCT
Portuguese (Portugal)DECAOCT
RomanianDEC2OCT
RussianДЕС.В.ВОСЬМ
SlovakDEC2OCT
SlovenianDEC2OCT
Serbian (Latin)DEC2OCT
SwedishDEC.TILL.OKT
ThaiDEC2OCT
TurkishDEC2OCT işlevi
UkrainianDEC2OCT
VietnameseDEC2OCT
Chinese (Simplified)DEC2OCT
Chinese (Hong Kong)DEC2OCT
Chinese (Traditional)DEC2OCT

Names from Microsoft's support site.

What it does

DEC2OCT(number, [places])

DEC2OCT(number, [places]) converts decimal to octal. The result is text, with optional leading zeros controlled by places.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

=DEC2OCT(45,4) returns "0055". All of these represent the same integer: decimal 45, binary 101101, octal 55, and hexadecimal 2D.

For a negative value, =DEC2OCT(-45,4) returns "7777777723". Encode 2^30-45=1073741779 in octal. The sign representation occupies ten digits even though places is four.

Quirks

These engineering conversions use signed fixed-width encodings, not arbitrary-length integers. The destination’s numeric range is -536,870,912 through 536,870,911. The decimal input is truncated toward zero. For a positive result a width too small gives #NUM!. A negative result uses ten digits; the current code still validates an explicitly supplied width before emitting it, despite documentation describing the width as ignored.

How to implement

Separate input parsing, signed interpretation and output formatting. Coerce the decimal number and truncate it toward zero to obtain integer v. Check v against the 30-bit signed target range. If negative, encode 2^30+v in base 8 using ten digits. Otherwise use repeated division by 8, reverse the remainders and left-pad to the requested width. Truncate the width and validate it in the current supported range one through ten. Return text; a decimal number formatted to look similar is a different value kind.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

DEC2OCT · 1 lines · calc-func/src/catalogue/engineering.rs on GitHub
6 dec2oct "DEC2OCT" (1, 2) [V "number", V "places"] |s, a, sv| { from_decimal(s, a, radix::dec2oct_kernel) }
dec2oct_kernel · 3 lines · calc-func/src/ported/engineering_radix_family.rs on GitHub
pub fn dec2oct_kernel(number: f64, places: Option<f64>) -> Result<ExcelText, WorksheetErrorCode> {
    dec_to_target_kernel(number, places, OCT_SPEC)
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
20430Windows, 64-bit, CPU not recorded4,807

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

4,807 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.

Alternatives

OCT2DEC converts in the reverse direction. BASE and DECIMAL provide general radix conversion with different sign rules. A full-width negative engineering encoding is not a minus-prefixed numeral; choose the pair whose sign convention fits your input.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents