OCT2DEC function

Converts an octal (base-8) number to its decimal (base-10) equivalent for database lookups and numeric conversions.

=OCT2DEC(number)

Generate a OCT2DEC formula

Describe what you need. The generator will reach for OCT2DEC where OCT2DEC is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How OCT2DEC reads its arguments
numberrequiredOCT2DEC
ArgumentRequiredDescription
numberRequiredAn octal text string or number (0-7 digits only); cannot contain 8, 9, negatives, or exceed 17,777,777 octal.

Returns

A decimal integer representing the base-10 value of an octal input.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Convert property ID from octal encoding to decimal

Property IDBedsBathsList PriceDays on Market
#1013245000014
#1024367500021
#103213250008
=OCT2DEC(101)

Result: 65

The property ID stored as octal 101 converts to decimal 65. This is useful when property identifiers are encoded in octal format for storage optimization and need to be converted to decimal for database queries or lookups.

2. Use converted octal ID to retrieve property details

ID (Decimal)AddressBedsBathsList Price
66456 Elm Ave43675000
69789 Maple Dr21325000
71321 Pine Ln32.5520000
=INDEX(B2:B4,MATCH(OCT2DEC("102"),A2:A4,0))

Result: 456 Elm Ave

The formula converts octal 102 to decimal 66, then searches column A for a matching ID. When IDs arrive in octal format but reference data uses decimal, OCT2DEC bridges the encoding difference for accurate INDEX/MATCH lookup.

3. Convert octal price tier codes for report filtering

PropertyBedsBathsTier (Octal)Days on Market
123 Oak St325514
456 Elm Ave437721
789 Maple Dr21458
=OCT2DEC("77")

Result: 63

The octal tier code 77 converts to decimal 63, representing the 600k-700k price bracket. When property pricing categories are encoded in octal for compact storage, OCT2DEC converts these to decimal integers for analytics, pivot tables, and price-range reports.

Common errors

Which OCT2DEC error are you seeing?
OCT2DEC returned an error#VALUE!
Verify the input contains only octal digits 0-7. If the source data includes 8 or 9, check the encoding—it may not actually be octal or may be corrupted during import.
#NUM!
Ensure the octal value is positive and does not exceed 7 digits. For larger IDs, split into multiple fields or use text-based identifiers without OCT2DEC conversion.
#VALUE!
Wrap the input in IFERROR() to handle missing values: =IFERROR(OCT2DEC(A2), 0). Ensure source cells contain valid octal strings before conversion.
ErrorWhy it happensHow to fix it
#VALUE!Input contains invalid octal digits (8 or 9), such as OCT2DEC("189") or OCT2DEC("298").Verify the input contains only octal digits 0-7. If the source data includes 8 or 9, check the encoding—it may not actually be octal or may be corrupted during import.
#NUM!Input exceeds the maximum octal value (17,777,777 octal = 2,097,151 decimal) or is a negative number like OCT2DEC("-101").Ensure the octal value is positive and does not exceed 7 digits. For larger IDs, split into multiple fields or use text-based identifiers without OCT2DEC conversion.
#VALUE!Input is empty, contains non-numeric characters like OCT2DEC("ABC"), or receives a formula error from an upstream cell.Wrap the input in IFERROR() to handle missing values: =IFERROR(OCT2DEC(A2), 0). Ensure source cells contain valid octal strings before conversion.

Tips and when to use something else

  • OCT2DEC is most useful for converting stored octal identifiers (like property codes or price tiers) into decimal for calculations. For regular property prices or days-on-market, which are already decimal, use those values directly.
  • Combine OCT2DEC with MATCH or INDEX when looking up records by octal-encoded keys: =INDEX(data, MATCH(OCT2DEC(key), ids, 0)).
  • If you need the reverse operation, use DEC2OCT to convert decimal back to octal—useful for exporting data back to systems that expect octal encoding.
  • For bit-level operations (not octal conversion), consider BITAND, BITOR, or BITXOR instead; these work on the binary representation and return different results than base conversion.

Frequently asked questions

What's the difference between OCT2DEC and just using the octal number directly?
Octal numbers are base-8 (digits 0-7), while spreadsheets work in base-10 by default. OCT2DEC interprets a string like "101" as octal (meaning 1×64 + 0×8 + 1 = 65 decimal) rather than one hundred and one. Without OCT2DEC, "101" is treated as decimal 101.
Can OCT2DEC handle negative octal numbers?
No. OCT2DEC only accepts positive octal values from 0 to 17,777,777 octal (2,097,151 decimal). Negative inputs return #NUM! error. If you need to convert signed values, process the sign separately: =IF(LEFT(A2,1)="-", -OCT2DEC(MID(A2,2,99)), OCT2DEC(A2)).
When should I use OCT2DEC instead of just entering the decimal value?
Use OCT2DEC when importing data from external systems that store numbers in octal encoding (legacy databases, firmware configs, or archived records). For natively decimal data like property prices or days on market, skip OCT2DEC and work with the values directly.
How large can an octal number be before OCT2DEC fails?
The maximum octal value is 17,777,777, which converts to 2,097,151 in decimal. Larger values return #NUM! error. For larger property IDs or codes, split the number into multiple fields and convert each part separately, or store them as text identifiers.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17