+ Reply to Thread
Results 1 to 13 of 13

Hexadecimal to decimal.

  1. #1
    Registered User
    Join Date
    10-11-2017
    Location
    Oulu
    MS-Off Ver
    2016
    Posts
    7

    Hexadecimal to decimal.

    Hey All,

    In the attatchment I have multiple hexadecimal numbers which I would like to be shown as decimal numbers next to hexadecimals. On the attatchemnt there is also instructions which digits are measuring values and which are something else. There is also mention about which value is LSB. I would like to have function how to convert those values easily to decimals but I do not have idea how to convert that long hexadecimals to decimals.
    Could somebody help me to make that function?

    Thank you in advance,

    Best regards,
    Eemilv
    Attached Files Attached Files

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Hexadecimal to decimal.

    could you show a part of a string to convert

  3. #3
    Registered User
    Join Date
    10-11-2017
    Location
    Oulu
    MS-Off Ver
    2016
    Posts
    7

    Re: Hexadecimal to decimal.

    Hey,

    The values in excel sheet which would need to be converted would be
    1e 00 00 00
    32 00 00 00
    5a 00 00 00
    aa 00 00 00
    ...
    ...
    And as time goes on those zeros starts to grow as data is cumulative.
    And take in note that first digit is LSB.
    Last edited by eemilv; 10-11-2017 at 04:03 AM. Reason: missing info

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Hexadecimal to decimal.

    with your example you can try: =HEX2DEC(LEFT(SUBSTITUTE(A2," ",""),8))

  5. #5
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Hexadecimal to decimal.

    Quote Originally Posted by sandy666 View Post
    with your example you can try: =hex2dec(left(substitute(a2," ",""),8))
    =hex2dec(mid(substitute(a2," ",""),7,8))

  6. #6
    Registered User
    Join Date
    10-11-2017
    Location
    Oulu
    MS-Off Ver
    2016
    Posts
    7

    Re: Hexadecimal to decimal.

    The last value (aa 00 00 00) as LSB is 170. This formula gives me 2852126720. Excel reads spaces as values when picking values with MID function so i think it should be =hex2dec(mid(substitute(a7," ",""),10,8))
    , but in this case it gives me 0.

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Hexadecimal to decimal.

    To me LSB is LowerSideBand (from KF radio)

  8. #8
    Registered User
    Join Date
    10-11-2017
    Location
    Oulu
    MS-Off Ver
    2016
    Posts
    7

    Re: Hexadecimal to decimal.

    Oh I see , In this case it means little endian. That basically means that least significat value is the first one. For example if I had hexadecimal 7DE in LSB, E would be most significant number and 7 least significant. And as excel uses MSB in calculations before using HEX2DEC I should turn these numbers around being ED7. Now here in my hex number if we take last row (aa 00 00 00) it means aa is least significant number as pair of numbers seems to be one value in this case. Before calculating this I need to turn these around being 00 00 00 aa. Hopefully this helps

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,921

    Re: Hexadecimal to decimal.



    =HEX2DEC(LOOKUP(2,1/(TRIM(MID(SUBSTITUTE(A2,0," "),ROW(INDIRECT("1:12"))*3-2,3))<>""),MID(A2,ROW(INDIRECT("1:12"))*3-2,2)))

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Hexadecimal to decimal.

    what about BruteForce way?

    =HEX2DEC(MID(A2,19,2)&MID(A2,16,2)&MID(A2,13,2)&MID(A2,10,2))

  11. #11
    Registered User
    Join Date
    10-11-2017
    Location
    Oulu
    MS-Off Ver
    2016
    Posts
    7

    Re: Hexadecimal to decimal.

    Thanks for everybody on replys! Sandy666 your function works perfectly! Thank you for that. This was my first time using excelforum for help and problem is solved in less than 3 hours, PERFECT.

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Hexadecimal to decimal.

    Ha ha ha Thanks
    Because I don't know too much about what you said in post#8 (BlackMagic!) maybe you can try with VHF/HF/UHF radio on LSB / USB?

    anyway

    If that takes care of your original question, & to say Thanks, please click on Add Reputtion (bottom left corner of the post of the person(s) who helped you)
    then select Thread Tools from the menu (top right corner of your thread) and mark this thread as SOLVED.
    If you did it - ignore it.
    Thank you.
    Last edited by sandy666; 10-11-2017 at 06:03 AM.

  13. #13
    Registered User
    Join Date
    09-17-2020
    Location
    Nova Gorica, Slovenia
    MS-Off Ver
    16
    Posts
    1

    Cool Re: Hexadecimal to decimal.

    0

    Long formula but it is working for 64-HEX characters:


    =HEX2DEC(MID(A24,1,8))*4*2^512+HEX2DEC(MID(A24,9,8))*2*2^512+HEX2DEC(MID(A24,17,8))*2^512+HEX2DEC(MID(A24,25,8))*2^256+HEX2DEC(MID(A24,33,8))*2^128+HEX2DEC(MID(A24,41,8))*2^64+HEX2DEC(MID(A24,49,8))*2^32+HEX2DEC(MID(A24,57,8))


    note: all 64 character must be present like the following example:

    "0000000000000000000000000000000000000000000000000000000000000fd1"

    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hexadecimal to Decimal
    By audi321 in forum Excel Formulas & Functions
    Replies: 32
    Last Post: 01-26-2017, 02:11 PM
  2. Hexadecimal to binary
    By [email protected] in forum Excel General
    Replies: 10
    Last Post: 06-16-2016, 10:32 AM
  3. [SOLVED] VBA convert decimal to hexadecimal numbers
    By igormigor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2016, 08:23 AM
  4. Using a "Do Until" loop to convert decimal numbers to hexadecimal
    By georgiapeach in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-13-2014, 03:41 PM
  5. string to hexadecimal?
    By Mark121 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-01-2008, 10:26 AM
  6. [SOLVED] I want to convert a column of hexadecimal numbers to decimal num
    By xs2sandeep in forum Excel General
    Replies: 2
    Last Post: 04-04-2006, 04:50 AM
  7. CONVERT HEXADECIMAL CELL TO DECIMAL NUMBER
    By JAY in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-24-2005, 11:06 PM

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