DEC2OCT function
DEC2OCT converts a decimal number to its octal equivalent and returns it as text, not a number. It turns up in IT, networking and low-level data work.
Example
Read it as a sentence: turn the decimal number 8 into octal, which gives 10.
A
B
C
D
1
10
2
3
Syntax
DEC2OCT(number, [places])
Arguments in [square brackets] are optional.
-
number(required) - The whole decimal number to convert (negatives allowed within the 10-digit range).
-
places(optional) - Minimum number of characters in the result; pads with leading zeros.
Returns: The octal equivalent.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=DEC2OCT(13) | 15 | Typical |
=DEC2OCT(-13) | 7777777763 | Negative (two's complement) |
=DEC2OCT(0) | 0 | Zero |
=DEC2OCT({1,2}) | 1 | Spill |
=DEC2OCT(13.9) | 15 | Decimal 13.9 truncates |
=DEC2OCT("13") | 15 | Text number |
=DEC2OCT("abc") | #VALUE! | Invalid digit |
=DEC2OCT(1E+15) | #NUM! | Too long input |
Watch out for
- Input is limited to 10 characters.
- Result is text, not a number.
Where it works
- Excel
- DEC2OCT is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Engineering functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .