DECIMAL function

DECIMAL converts text representing a number in any base (2 to 36) into a base-10 decimal number suitable for calculations and comparisons.

=DECIMAL(text, radix)

Generate a DECIMAL formula

Describe what you need. The generator will reach for DECIMAL where DECIMAL 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 DECIMAL reads its arguments
textrequiredradixrequiredDECIMAL
ArgumentRequiredDescription
textRequiredText string containing digits valid for the given radix; characters outside that range return #VALUE!.
radixRequiredInteger base of the input number system, ranging from 2 to 36; values outside this range return #NUM!.

Returns

A decimal number representing the input text converted from the specified base to base 10.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Extract and convert hexadecimal warehouse location code

SKUWarehouseOnHandReorderPointCost
A1F2WH-North453012.5
B3E8WH-South12208.75
=DECIMAL("1F",16)

Result: 31

The hex code '1F' (extracted from SKU A1F2's location portion) converts to decimal 31. This is used when warehouse location codes are stored in hexadecimal and need numeric IDs for lookups or sorting.

2. Decode binary reorder point status flags

SKUWarehouseOnHandReorderPointStatus
A1F2WH-North45301101
C5A7WH-East78401010
=DECIMAL("1101",2)

Result: 13

Binary code '1101' converts to decimal 13. Each bit encodes warehouse availability (bit 1=North, bit 2=South, bit 3=East, bit 4=West); decimal 13 means warehouses 1, 3, and 4 have stock.

3. Evaluate cost threshold by converting encoded SKU base-36

SKUWarehouseOnHandReorderPointCost
A1F2WH-North453012.5
B3E8WH-South12208.75
C5A7WH-East784015.25
=IF(DECIMAL("F2",16)>100,"URGENT","OK")

Result: URGENT

Hex code 'F2' (15×16 + 2) converts to 242, which exceeds the 100 threshold, returning 'URGENT'. This pattern flags high-priority SKUs when encoded values are compared against cost or risk limits.

Common errors

Which DECIMAL error are you seeing?
DECIMAL returned an error#NUM!
Verify that radix is an integer between 2 and 36 inclusive. Common bases: 2 (binary), 8 (octal), 10 (decimal), 16 (hexadecimal).
#VALUE!
Ensure all characters in text are valid for the radix: binary uses 0–1, hex uses 0–9 and A–F, base 36 uses 0–9 and A–Z. Remove or correct invalid characters.
#NUM!
Supply a non-empty text string with at least one valid digit. Check that the referenced cell is not blank before passing it to DECIMAL.
ErrorWhy it happensHow to fix it
#NUM!The radix argument is outside the valid range of 2–36 (e.g., =DECIMAL("FF",50) or =DECIMAL("10",1)).Verify that radix is an integer between 2 and 36 inclusive. Common bases: 2 (binary), 8 (octal), 10 (decimal), 16 (hexadecimal).
#VALUE!The text argument contains a character invalid for the given radix (e.g., '9' in binary, or 'G' in hexadecimal).Ensure all characters in text are valid for the radix: binary uses 0–1, hex uses 0–9 and A–F, base 36 uses 0–9 and A–Z. Remove or correct invalid characters.
#NUM!The text argument is empty or contains only spaces (e.g., =DECIMAL("",16) or =DECIMAL(" ",8)).Supply a non-empty text string with at least one valid digit. Check that the referenced cell is not blank before passing it to DECIMAL.

Tips and when to use something else

  • DECIMAL accepts bases 2 through 36. For bases > 10, use letters A–Z (case-insensitive) where A=10, B=11, …, Z=35.
  • To convert *from* decimal *to* another base, use the BASE function (Google Sheets) or write a custom formula; Excel lacks a direct equivalent.
  • If you work exclusively with hexadecimal or binary, consider HEX2DEC or BIN2DEC as alternatives for readability, though DECIMAL is more flexible.
  • Avoid DECIMAL when pattern-matching or validating encoded codes; use REGEX or FIND instead. Reserve DECIMAL for actual numeric conversions and arithmetic.

Frequently asked questions

How do I convert a decimal number back to hexadecimal or binary?
Use the BASE function (Google Sheets) or custom formulas. Excel 2019+ includes BASE; older versions require a user-defined function. DECIMAL only goes one direction: other bases → decimal.
What's the difference between DECIMAL("10",16) and DECIMAL("10",10)?
DECIMAL("10",16) returns 16 (1×16¹ + 0×16⁰), while DECIMAL("10",10) returns 10 (1×10¹ + 0×10⁰). The radix determines how the digits are interpreted, not the result.
Can DECIMAL handle fractional or negative numbers?
No—DECIMAL requires non-negative integers in the specified base. Use INT or TRUNC to extract the integer part before conversion. Negative signs are not supported.
Why does DECIMAL("FF",8) fail with #VALUE! instead of returning a number?
Because 'F' is not a valid digit in base 8 (which uses only 0–7). DECIMAL validates every character against the radix before conversion. Use base 16 or higher to include letters A–F.

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