Converts a hexadecimal number to decimal.
HEX2DEC(hexadecimalnumber)
returns a (decimal) number, given hexadecimalnumber, which may be text, or a number (taken to be hexadecimal although it is not).
hexadecimalnumber may have up to ten digits in two's complement representation; positive numbers are 0 to 7FFFFFFFFF (representing 0 to 239-1 decimal) and negative numbers FFFFFFFFFF to 8000000000 (representing -1 to -239 decimal).
HEX2DEC("1E")
returns 30 as a (decimal) number.
HEX2DEC("FFFFFFFFFE")
returns -2 as a (decimal) number.
HEX2DEC($B$10)
returns the contents of cell B10 as a (decimal) number.
HEX2DEC(20)
returns 32 as a (decimal) number. The number 20 is read as hexadecimal. This is not recommend since changing the parameter to 1F without double quotes will result in HEX2DEC converting the parameter to F1 and doing a cell lookup.
Converting a Web Color Code
Imagine you're a web developer working with a design team. They give you a specific color for a button, and the color is provided as a hexadecimal code: #A0D2E4. You need to understand the exact intensity of each color component (Red, Green, Blue) on a scale from 0 to 255 to use it in a different format, like an RGB value.
This is where you would use the HEX2DEC concept. The hexadecimal code #A0D2E4 is broken down as follows:
Now, let's use the HEX2DEC function on each part.
Step 1: Convert Red (A0)
A hexadecimal number is a positional system, just like decimal. Each position is a power of 16.
Step 2: Convert Green (D2)
Step 3: Convert Blue (E4)
Here is the table summarizing the conversions:
Component | Hexadecimal (Input to HEX2DEC) | Calculation (HEX2DEC Function) | Decimal (Output) | ||
|---|---|---|---|---|---|
A | B | C | D | ||
1 | Red | A0 | (10 * 16^1) + (0 * 16^0) | 160 | |
2 | Green | D2 | (13 * 16^1) + (2 * 16^0) | 210 | |
3 | Blue | E4 | (14 * 16^1) + (4 * 16^0) | 228 |
So, the hexadecimal color code #A0D2E4 is equivalent to the RGB value (160, 210, 228). The HEX2DEC function allows us to understand the precise intensity of each color channel, which is crucial for various applications beyond web design, such as graphics programming, video editing, and digital art.
PRODUCT & FEATURES
RESOURCES
Terms | Privacy | Spam Policy
© 2026 Zapof