Summary

The Excel OCT2DEC function converts an octal number to its decimal equivalent. For example, the following formula converts the octal number 23 to decimal:

=OCT2DEC(23) // returns 19

Purpose 

Converts an octal number to its decimal equivalent

Return value 

A decimal number

Syntax

=OCT2DEC(number)
  • number - The octal number you want to convert.

Using the OCT2DEC function 

The OCT2DEC function is used to convert octal numbers (base 8) to decimal numbers (base 10). This is useful when working with different number systems, especially in engineering and computer science applications.

Key features

  • Converts octal numbers to decimal numbers
  • Handles both positive and negative octal numbers (using two's-complement for negatives)
  • Returns a decimal number (as a number, not text)

To get the octal representation of a decimal number, use the DEC2OCT function.

Table of contents

Example #1 - Basic conversion

To convert the octal number 10 to decimal, use the following formula:

=OCT2DEC(10) // returns 8

The spreadsheet below shows some basic conversions of octal numbers to decimal numbers:

OCT2DEC function basic conversion in Excel, showing octal 10 converting to decimal 8

Example #2 - Negative octal numbers

Excel represents negative numbers in non-decimal bases (like octal) using two's complement notation with a fixed width of 10 characters. For example, the decimal number -2 is represented as the octal number 7777777776.

=OCT2DEC(7777777776) // returns -2

This is because Excel represents the number using 30 bits, where the first bit is used for the sign, and the remaining 29 bits represent the value. Octal numbers from 0 to 3777777777 represent positive numbers, and octal numbers from 4000000000 to 7777777777 represent negative numbers.

In other words, the largest positive decimal number you can represent is 2^29 - 1 (536,870,911), and the smallest negative decimal number you can represent is -2^29 (-536,870,912). The spreadsheet below shows the octal numbers corresponding to positive and negative decimal numbers:

OCT2DEC function negative octal numbers in Excel, showing octal 7777777776 converting to decimal -2

Example #3 - Error conditions

There are several error conditions that can occur when using the OCT2DEC function. For example, if the input contains more than 10 digits, OCT2DEC returns a #NUM! error. This behavior and other error conditions are shown in the example below:

OCT2DEC function error conditions in Excel, showing #NUM! error for octal numbers with more than 10 digits

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.