Excel functions / Math
HEX2DEC function
Turns a hexadecimal number into an ordinary one.
Syntax
=HEX2DEC(number)
Arguments
number: Up to ten hexadecimal digits, as text.
When to use it
HEX2DEC reads a hexadecimal number and gives it as an ordinary number. It takes apart colour codes and the codes that come out of systems and devices.
Examples
FF as a number
A B C 1 Hex 2 FF 255 In C2:
=HEX2DEC(A2)→ 255The green part of a colour code
A B C 1 Colour 2 #0F7A49 122 In C2:
=HEX2DEC(MID(A2, 4, 2))→ 122
Common mistakes
- The # sign. HEX2DEC reads only the digits. Cut the # off a colour code first.
HEX2DEC in other languages
Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.
- Czech: HEX2DEC
- Danish: HEX.TIL.DEC
- Dutch: HEX.N.DEC
- Finnish: HEKSADES
- French: HEXDEC
- German: HEXINDEZ
- Hungarian: HEX.DEC
- Italian: HEX.DECIMALE
- Norwegian: HEKSTILDES
- Polish: SZESN.NA.DZIES
- Portuguese (Brazil): HEXADEC
- Portuguese (Portugal): HEXADEC
- Russian: ШЕСТН.В.ДЕС
- Spanish: HEX.A.DEC
- Swedish: HEX.TILL.DEC
- Turkish: HEX2DEC