+ Reply to Thread
Results 1 to 8 of 8

Changin =DEC2HEX conversion

Hybrid View

  1. #1
    Registered User
    Join Date
    12-17-2007
    Posts
    8

    Changin =DEC2HEX conversion

    Hello again,
    I'm using a spreadsheet to track some issues and it's pretty much complete (thanks again!) but I just noticed that when I use DEC2HEX it converts it into a hex number different from what I need.
    For example, 03406812056 converts to CB0FD398 with DEC2HEX but it should convert to 2267F198. I have the DEC field formatted for text due to the fact that the first 0 is important and is removed using any other format (unsure if that matters for this situation)

    Thanks again

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078
    No 2267F198 in hex is 577237400 decimal.

    CB0FD398 in hex is indeed 3406812056

    Use the scientific calculator in Windows XP to confirm this.
    Just enter the number and click the radio button to transform it into Hex or Decimal
    Last edited by Special-K; 12-18-2007 at 08:07 PM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    12-17-2007
    Posts
    8
    Quote Originally Posted by Special-K
    No 2267F198 in hex is 577237400 decimal.

    CB0FD398 in hex is indeed 3406812056

    Use the scientific calculator in Windows XP to confirm this.
    Just enter the number and click the radio button to transform it into Hex or Decimal
    I'm not very familiar with any dec/hex formalities and differences but if it matters this is for a cell phone. Our conversion calculator is accurate; if I were to go to the manufacturers website (client access) and typed in 03406812056 for dec I would get back the same results as I would if I typed in 2267F198 for hex. Our decimals are 11 digits and MUST have the 0 at the beginning. I noticed that if you remove the 0 in front of the decimal number DEC2HEX does not change the hex conversion

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    there arn't any formalities! hex is base 16 where as dec is base 10 its maths and doesn't change.
    probably your dec number isnt what you think it is and 'dec' means something else. what website converts this for you?

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699
    If 03406812056 converts to 2267F198 then that looks like you are converting the first 3 digits to hex (034 to 22) and then the last 8 digits (06812056 to 67F198) and concatenating the two together….so this formula should give the conversion you want given that your original number is in A2

    =DEC2HEX(LEFT(A2,3))&DEC2HEX(RIGHT(A2,8))

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    good spot dll i tried a 4/4split on the hex then gave up!

  7. #7
    Registered User
    Join Date
    12-17-2007
    Posts
    8
    Quote Originally Posted by daddylonglegs
    If 03406812056 converts to 2267F198 then that looks like you are converting the first 3 digits to hex (034 to 22) and then the last 8 digits (06812056 to 67F198) and concatenating the two together….so this formula should give the conversion you want given that your original number is in A2

    =DEC2HEX(LEFT(A2,3))&DEC2HEX(RIGHT(A2,8))

    Brilliant! Changed it to an IF function [=IF(D3="","",(DEC2HEX(LEFT(D3,3))&DEC2HEX(RIGHT(D3,8))))] and it works PERFECT! Any idea why all our mfg (Moto, LG, Kyocera, Samsung, etc) would use this instead of the standard conversion?

    thanks!
    Last edited by ConfusedTech; 12-19-2007 at 04:01 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1