DEC2OCT Function in Google Sheets

Convert a decimal number to an octal number using the DEC2OCT function.

DEC2OCT Function

The DEC2OCT function in Google Sheets is used to convert a decimal number to its octal equivalent.

Syntax

DEC2OCT(decimal_number, [significant_digits])
  • decimal_number: The decimal number you want to convert. This is a required parameter.
  • significant_digits: (Optional) The number of digits you want the octal number to contain.

Examples

  1. Basic Conversion

Convert the decimal number 8 to octal:

=DEC2OCT(8)

This will output 10.

  1. Conversion with Significant Digits

Convert the decimal number 7 to octal with 3 significant digits:

=DEC2OCT(7, 3)

This will output 007.

Notes

  • The function can handle decimal numbers from -536,870,912 to 536,870,911.
  • If significant_digits is provided, the octal result will be padded with leading zeros to match the specified length.
  • DEC2BIN: Convert a decimal number to a binary number.
  • DEC2HEX: Convert a decimal number to a hexadecimal number.