# HEX2DEC

The `HEX2DEC` function converts a signed hexadecimal number to its decimal equivalent. This function is commonly used in engineering calculations where hexadecimal numbers are used to represent signed values.

## Usage

Use the `HEX2DEC` formula with the syntax shown below, it has 1 required parameter:

Parameters:
The signed hexadecimal number to convert to decimal. The signed hexadecimal number must be a text string and can include up to 10 characters, which can be any combination of numbers (0-9) and letters (A-F, a-f). The most significant bit of the most significant byte is used to represent the sign of the value. If the most significant bit is 0, the value is positive, and if it is 1, the value is negative.

## Examples

Here are a few example use cases that explain how to use the `HEX2DEC` formula in Google Sheets.

### Convert signed hexadecimal numbers to decimal

The `HEX2DEC` function is useful for converting signed hexadecimal numbers to decimal, which is a common task in engineering calculations. For example, if you have a signed hexadecimal number stored in a cell, you can use the `HEX2DEC` function to convert it to decimal and perform calculations with it.

### Convert hexadecimal color codes to decimal

In web development and graphic design, colors are often represented in hexadecimal format. The `HEX2DEC` function can be used to convert these hexadecimal color codes to decimal values, which can be useful for certain types of color calculations.

## Common Mistakes

`HEX2DEC` not working? Here are some common mistakes people make when using the `HEX2DEC` Google Sheets Formula:

### Incorrect input format

The input for HEX2DEC must be a signed hexadecimal number. If the input is not in this format, the formula will return an error. Make sure the input is formatted correctly.

### Missing input

If the input for HEX2DEC is missing, the formula will return an error. Make sure the input is provided.

### Incorrect input type

The input for HEX2DEC must be a signed hexadecimal number. If the input is not in this format, the formula will return an error. Make sure the input is of the correct type.

### Incorrect output format

The output for HEX2DEC will be a decimal number. If the output is not in this format, there may be an error in the formula or in the input. Double-check both the input and the formula.

### Unexpected error

If HEX2DEC returns an unexpected error, double-check the input and the formula for any mistakes. If everything looks correct, try refreshing the sheet or restarting your browser.

The following functions are similar to `HEX2DEC` or are often used with it in a formula:

• `DEC2HEX`

The `DEC2HEX` formula is an engineering formula in Google Sheets that converts a decimal number to its hexadecimal equivalent. It is commonly used to convert numbers to a format that is easier to read and work with in certain applications.

• `BIN2DEC`

The `BIN2DEC` formula is an engineering formula used to convert a signed binary number to a decimal number. This formula is commonly used in computer science and engineering fields.

• `OCT2DEC`

The `OCT2DEC` function converts a signed octal number to its decimal equivalent. It takes one required parameter, the signed_octal_number, which is the signed octal number you want to convert to decimal. The function returns the decimal equivalent of the signed octal number.

• `HEX2OCT`

The `HEX2OCT` function converts a signed hexadecimal number to signed octal notation. This is commonly used in engineering calculations that require conversion of hexadecimal numbers to octal. The function takes a signed hexadecimal number as input and returns a signed octal number as output.

You can learn more about the `HEX2DEC` Google Sheets function on Google Support.