title: convert negative decimal number into HEX
body: <p>I must admit I don't remember much about HEX and so on from school (25 years ago). In any case, I have some values in decimal format which I need to convert into HEX. I am using Excel but I could write a function in VBA if necessary (or do it by code in VB.NET).</p>
  
  <p>I already know how the HEX-result should look like (another source) but I need to use Excel to get this result exactly. The source of decimal input and also the result of the (right) HEX result is from a Linux-system if that is important to know.</p>
  
  <p>Positive numbers seem to be converted correctly while negative numbers give me an headache in the sense that Excel adds in the beinning of the HEX two additional letters (two FF) compared to result I want. </p>
  
  <p>Example: 
  Decimal input: -524288</p>
  
  <p>Correct HEX-output I must obtain: FFF80000</p>
  
  <p>Using formula in Excel I get: FFFFF80000
  (I get 2 FF extra in the beginning of the HEX-output)</p>
  
  <p>Another example: </p>
  
  <p>Decimal Input: -29446758</p>
  
  <p>should be FE3EAD9A</p>
  
  <p>but in Excel I get FFFE3EAD9A</p>
  
  <p>It seems like I always get 2 extra FF in the HEX-output. </p>
  
  <p>Can someone explain (in an easy way) why I get the 2 extra FF and if I can safely remove them?</p>