Ask Experts Questions for FREE Help !
Ask
    nigel_cro's Avatar
    nigel_cro Posts: 6, Reputation: 1
    New Member
     
    #1

    Dec 3, 2009, 08:25 AM
    Excel convert hex big endian to hex little endian
    Hi Guys,

    Noob on this site so forgive any indiscretions. I have found a number of posts here already which go part way to answering my problem, but I am now left with a specific issue which I am sure someone on here (JB? ) can answer with relative ease.

    I need to take a HEX string (eg D0 BF FF FF) and turn it to little endian (eg FF FF BF D0) in Excel. I have got part way to a VB scripted module but I really don't know enough VB to even know where I am going wrong.

    Any suggestions would be gratefully received.

    All the best,

    Nigel
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #2

    Dec 3, 2009, 11:25 AM


    If your text string in A2 is shown exactly like you demonstrated above with spaces between each quad, then use this worksheet formula to reverse the order of the quads:

    =RIGHT(A2,2) & MID(A2,6,4) & MID(A2,4,3) & LEFT(A2,2)

    If your data does not match this exact format, click on GO ADVANCED and use the paperclip icon to upload a sample worksheet with several examples of your data and your desired results.
    nigel_cro's Avatar
    nigel_cro Posts: 6, Reputation: 1
    New Member
     
    #3

    Dec 3, 2009, 02:27 PM
    JB,

    Thanks for the really prompt response.

    I knew I would get something wrong - I would like to input the HEX string as a continuous string, it makes the inputting process a whole lot easier, to have to include spaces would build unnecessary effort and room for error into the process.

    So, the actual input will look like [D0BFFFFF] and the output would look similar [FFFFBFD0]. Just to emphasise, both input and output would be in continuous strings.

    I'm sorry to have wasted your time, thanks for the help.

    All the best,

    Nigel
    KISS's Avatar
    KISS Posts: 12,510, Reputation: 839
    Uber Member
     
    #4

    Dec 3, 2009, 03:26 PM

    I'm not sure what JB did wrong. He just assumes the inputted string is a fixed length and gives you the functions to create an output string of the same length in the proper order.

    If you wanted to reverse an entire file, say something like INTEL hex format, then that's something a little different,

    The functions should be usable based on our understanding of the problem.
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #5

    Dec 3, 2009, 05:18 PM

    Hopefully you'll pull these two examples apart and see what's going on so you can use this technique yourself in the future.

    This is for reversing your text string 2 characters at a time with no spaces:

    =RIGHT(A1,2) & MID(A1,5,2) & MID(A1,3,2) & LEFT(A1,2)
    nigel_cro's Avatar
    nigel_cro Posts: 6, Reputation: 1
    New Member
     
    #6

    Dec 4, 2009, 12:59 AM
    Excellent! Thanks JB, it works a treat. I would still love to know where I am going wrong in my attempts to write a scripted solution in a module, but that can wait for a while, I guess I will have to get the books out over Xmas.

    Once again, thanks for your help.

    All the best,

    Nigel
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #7

    Dec 4, 2009, 02:36 AM

    I tend to rule out VBA for tasks that can be handled automatically with worksheet formulas.

    Glad I could help.
    nigel_cro's Avatar
    nigel_cro Posts: 6, Reputation: 1
    New Member
     
    #8

    Dec 4, 2009, 03:48 AM
    JB,

    Just one more question please...

    Is there a decent reference work that you would recommend for dealing with Excel and all of it's functionalities? Something that will beef up my knowledge of formulas and will lead me on to working with VBA to compile modules.

    Thanks again,

    Nigel
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #9

    Dec 4, 2009, 11:57 AM

    Nope, I've never read a book so couldn't recommend one. Nothing is more educational than real-world need coupled with a forum or two of people willing to help you work out complicated real-world scenarios.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Excel: Convert numbers to date [ 4 Answers ]

I'm using excel 07 and I have a cell containing the number 11291997 which represents 11/29/1997. How can I convert this to a date format. The 11291197 is number formatted. Any suggestions would help, thanks!

Why do I have a big vajina? [ 10 Answers ]

I'm 13 and I don't want to ask my mum but I have a really big vajina I can't swim with out everyone seeing and I amm about 80 Kg. please help what is wrong?? :(

What does the term ''BIG'' really mean [ 6 Answers ]

Well I just wanted to know because I think it can mean different things like tall, fat... and so on. Wats your opinion

How to convert a .wab-file into excel [ 9 Answers ]

I have the following problem: I have my contacts in groups in my outlook express contact list. I need this contacts, sorted by groups in cvs or excel. If I import them to e.g. Outlook I get the contacts, but not sorted in groups. I can save the groups as a .wab-file, but do I get them into excel?

Convert Excel workbook to Word [ 1 Answers ]

I have an Excel workbook that I would like to convert to Word. The Excel workbook has multiple tabs and I would like the workbook to be converted to a word doc. The key is that the word doc be able to be edited. When I copy the area of the tabs in Excel and paste into Word as HTML Format, it pastes...


View more questions Search