HEX2DEC Excel Formula

Author Zaheer    Category Formulas     Tags ,

Do you use Microsoft Excel in your engineering computation? Well, if yes, you must learn the different functions of Excel. For such reasons, it will let you learn and use the program in such an easy way. Excel has different functions when it comes to converting value related to engineering computation and one of these functions is HEX2DEC. Though HEX2DEC is seldom use, but still it is important to know its function and purpose just in case you will need it eventually for excel.

HEX2DEC Definition

This is the function that alters hexadecimal number to decimal integer. A hexadecimal number has 16 characters or bits. The hexadecimal value in this function is represented by a string called varchar and changes it to 64-number signed known as bigint.

HEX2DEC Microsoft Excel Formula

When doing HEX2DEC function, user must observe the formula:

=HEX2DEC(number)

In the formula the number is the hexadecimal value desired to alter to decimal figure. In the function, the hexadecimal integer wish to change must not go beyond 40 bits or ten characters. The most important bit of the figure is identified as the sign bit and the residual 39 bits are the identified as magnitude bits. Once the value is in negative form it must be expressed in two compliment note.

Notes

Listed Below are the Key Pointers in Using HEX2DEC Function:

  • The type in argument should be considered as legitimate hexadecimal value, otherwise there will be an exception that will be thrown.
  • The hexadecimal numbers that is in the compelling range must be embodied by strings of maximum 16 characters with no optional ‘0x’ prefix or until 18 characters, which include the ‘0x’ prefix. In this function leading zeros are no longer needed.
  • Hexadecimal figures are not totally case sensitive and lower, upper or combination of cases is all accepted.
  • It is important to take note that HEX2DEC function must be utilized with string symbols of hexadecimal values for instance nvarchar, varchar. Once you employ a literal hexadecimal without placing it within quotes then it will be read as SQL, as a number directly and it is no longer required to utilize conversion function.
  • The least and utmost conversion sort is from -9,223,372,036,854,775,808 unto +9,223,372,036,854,775,807. In hexadecimal the numbers are written as 0×8000000000000000 up to 0x7fffffffffffffff.

Examples:

=HEX2DEC(1) = 1

=HEX2DEC(“1″) = 1

=HEX2DEC(“01″) = 1

=HEX2DEC(“001″) = 1

=HEX2DEC(“2″) = 2

=HEX2DEC(“E”) = 14

=HEX2DEC(“FB”) = 251

=HEX2DEC(“1FF”) = 511

=HEX2DEC(“A5″) = 165

=HEX2DEC(“FFFFFFFF5B”) = -165

=HEX2DEC(“3D8B9″) = 252089

=HEX2DEC(“FFFFFFFFF”) = 68719476735

=HEX2DEC(“FFFFFFFFFF”) = -1

=HEX2DEC(“FFFFFFFFFFF”) = #NUM!

=HEX2DEC(“-200″) = #NUM!

=HEX2DEC(“HIJKLMN”) = #NUM!

=HEX2DEC(“some text”) = #NUM!

These are the example that you could try on your worksheet. To understand it more, begin inputting data from A1 cell to acquire the same result.

It is also important to always remember that once the number you keyed in is more than 10 characters or is not a legitimate hexadecimal number, the answer will appear as #NUM! error value. Additionally, make sure to convert hexadecimal number between double quotes HEX2DEC function.

Post comment