Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions > Engineering > DEC2HEX

 

DEC2HEX(number [,places])

 
 Returns the number converted from decimal to hexadecimal.

 numberThe decimal integer you want to convert.
 placesThe number of characters to use.

 REMARKS
 
  • This function is only available if you have the Analysis ToolPak add-in installed.
     
  • If any of the arguments are not numeric, then #VALUE! is returned.
     
  • If "number" < -549,755,813,888, then #NUM! is returned.
     
  • If "number" > 549,755,813,887, then #NUM! is returned.
     
  • If "number" < 0, "places" is ignored and a 10-character (40-bit) hexadecimal number in which the most significant bit is the sign bit is returned. The remaining 39 bits are magnitude bits.
     
  • If "number" < 0, then two's-complement notation is used to represent the number.
     
  • If "places" is not an integer, it is truncated.
     
  • If "places" < 0, then #NUM! is returned.
     
  • If "places" is left blank, then the minimum number of characters necessary is used.
     
  • The "places" is useful for padding the return value with leading 0s.
     
  • If "places" is less than the number of characters needed, then #NUM! error value.

     EXAMPLES
     
     A
    1=DEC2HEX(100,4) = 0064
    2=DEC2HEX(-54) = FFFFFFFFCA
    3=DEC2HEX(100.6,4) = 0064
    4=DEC2HEX(100,-4) = #NUM!
    5=DEC2HEX("some text",4) = #VALUE!
    6=DEC2HEX(6,"some text") = #VALUE!
     

     Functions - D | Index - D | Office Online 

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.Top