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

 

HEX2BIN(number, places)

 
 Returns the number converted from hexadecimal to binary.

 numberThe hexadecimal number 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 "number" is not a valid hexadecimal number, then #NUM! is returned.
     
  • If "number" < 0, then "places" is ignored and a 10-character binary number is returned.
     
  • If "number" < 0, then it cannot be less than FFFFFFFE00, and if number is positive, it cannot be greater than 1FF.
     
  • If "number" contains more than 10 characters (10 bits), then #NUM! is returned.
     
  • If "number" contains 10 characters then the first number represents the sign of 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.
     
  • If "places" is not numeric, then #VALUE! is returned.
     
  • If "places" is less than the number of characters needed, then #NUM! is returned.
     
  • The "places" is useful for padding the return value with leading 0s (zeros).
     
  • Any negative numbers are represented using two's complement notation.

     EXAMPLES
     
     A
    1=HEX2BIN("F",8) = 00001111
    2=HEX2BIN("F",8.9) = 00001111
    3=HEX2BIN("B7") = 10110111
    4=HEX2BIN("FFFFFFFFFF") = 1111111111
    5=HEX2BIN("FFFFFFFFFF",14) = #NUM!
    6=HEX2BIN("FFFFFFFFFF",-2) = #NUM!
    7=HEX2BIN("FFFFFFFFFF","some text") = #VALUE!
     

     Functions - H | Index - H | Office Online 

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