Google Sheets
DECIMAL function in Google Sheets
The DECIMAL function converts the text representation of a number in another base, to base 10 (decimal). .
=DECIMAL(value, base)DECIMAL syntax and parameters
Two arguments, two required.
- valuestringRequired
- basenumberRequired
DECIMAL examples
Formulas you'll actually reuse.
A hex string back to a number:
=DECIMAL("2A", 16)Result
42A binary string from a flags column into its integer value:
=DECIMAL(A2, 2)Result
42
DECIMAL in Excel
Same name — your formula ports as-is.
Try DECIMAL in the playground
Edit the example — nothing to install.
Preloaded with the DECIMAL formula from Example 1 — change anything and watch it respond.
Loading the editor…
DECIMAL errors
What they mean — and the fixes.
#NUM!The text contains a digit that isn't valid in that radix — e.g. a 2 in a binary string.
Related functions
More ways Google Sheets gets this done.
- ABSReturns the absolute value of a number.MathExcel
- ACOSReturns the inverse cosine of a value, in radians.MathExcel
- ACOSHReturns the inverse hyperbolic cosine of a number.MathExcel
- ACOTReturns the inverse cotangent of a value, in radians. .MathExcel
- ACOTHReturns the inverse hyperbolic cotangent of a value, in radians. Must not be between -1 and 1, inclusive..MathExcel
- ASINReturns the inverse sine of a value, in radians.MathExcel