excel - convert negative decimal number into HEX -


I have to admit that I do not remember much about hex and that is from school (25 years ago). In any case, I have some values ​​in decimal format which I need to convert to hex. I am using excel but if necessary, I can write a function in VBA (or it can code in VB.Net).

I already know how the hex-result should look (another source), but I need to use Excel to get this result properly, the source of decimal input and ( On the right side) It is important to know if the result of hex result is with Linux-system.

Positive numbers begin to change in the right way, whereas negative numbers give me a headache. In this sense, the hex adds to the beat of two additional letters (two FFs) compared to its result.

Example: Decimal Input: -524288

I have to get the right hex output: FFF80000

Find me using Excel in formula: FFFFF 80000 (I get 2FF Is the output of hex Another example:

decimal input: -29446758

should be FE3EAD9A

but in Excel I get FFFE3EAD9A

It seems that I always get 2 additional FFs in hex output.

Can anyone explain (in an easy way) why I get 2 additional FFs and if I can remove them safely?

In Excel, = DEC2HEX returns 10 characters by default

If you want to receive only 8, then your question is suggested:

  = DEC2HEX (A1,8)   

Then Also, as long as you do not have a compatibility problem, you can leave the default number Remember that "F" character acts as a padding for negative numbers (similarly "0" is for positive numbers).

Edit

The following tasks:

  = Wright (DEC2HEX (A1) , 8)    

Comments