DECIMAL function
DECIMAL converts a binary, hex or other-base text string into an ordinary base-10 number. It is the reverse of BASE, and the text must use only characters valid for that base.
Example
Read it as a sentence: turn the base 16 text FF into an ordinary decimal number, which gives 255.
A
B
C
D
1
255
2
3
Syntax
DECIMAL(text, radix)
-
text(required) - The number written in the other base, as text.
-
radix(required) - The base of that text, from 2 to 36.
Returns: The ordinary base-10 number.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=DECIMAL("FF",16) | 255 | "FF",16 |
=DECIMAL("ff",16) | 255 | Lowercase "ff" |
=DECIMAL("zz",36) | 1295 | "zz",36 |
=DECIMAL("",2) | 0 | Empty string |
=DECIMAL(111,2) | 7 | Number input 111 |
=DECIMAL(REPT("1",255),2) | 5.7896E+76 | 255 chars |
=DECIMAL("2",2) | #NUM! | Digit beyond radix |
=DECIMAL("1",1) | #NUM! | Radix 1 |
Watch out for
- Characters not valid for the base give #NUM!.
- Always pass the text in quotes or as text.
Where it works
- Excel
- DECIMAL arrived in Excel 2013. Older versions do not have it.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Math and trig functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .