+ Reply to Thread
Results 1 to 9 of 9

Formatting data in Excel

  1. #1
    Registered User
    Join Date
    01-15-2010
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    4

    Question Formatting data in Excel

    Hey all!
    Long time reader, first time poster!

    have a bit of a weird question and was wondering if somebody could help me out?

    I have had some data extracted in the format

    Computer 1
    CPU: 2ghz
    Hard Drive: 500GB
    RAM: 6GB
    Computer 2
    CPU: 2.2ghz
    Hard Drive: 500GB
    RAM: 6GB


    ETC (and there are about 10,000 records in this format!)

    I have no Idea how to get it in the format

    Computer name: CPU: Hard Drive: RAM:
    Computer 1 2GHz 500GB 6GB
    Computer 2 2.2GHz 500GB 6GB


    anybody got any ideas?

    Thanks in advance for your help
    Last edited by EpicSnail; 01-15-2010 at 03:36 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Bit of a weird one!

    Welcome to the fourm,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    01-15-2010
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Bit of a weird one!

    oops, really sorry will change that now!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formatting data in Excel

    Thanks for fixing that.

    Say that data is in range A1:A8

    Now in B2 enter:

    =INDEX($A$1:$A$8,4*(ROWS($A$1:$A1)-1)+1)

    adjust the A1:A8 to include full range..

    copy that across to D1 and change the first $A$1 to $A$2 in B1, $A$3 in C1 and $A$4 in D1

    Then copy all 4 down as far as you need to get all your data

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formatting data in Excel

    If a macro is ok, try this:

    Please Login or Register  to view this content.
    How/Where to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save your sheet

    The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.

    Remove the line of code marked in red if you don't want the original column of data in column A to be removed.
    Last edited by JBeaucaire; 01-15-2010 at 03:49 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Registered User
    Join Date
    01-15-2010
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Formatting data in Excel

    Thanks for that
    One thing I forgot to mention (im feeling rather dense today)

    Sometimes the data may include
    VRAM: 128MB
    or
    NIC: 10/100/1000

    or similar

    Doh!

    any ideas on that one?

    Cheers

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formatting data in Excel

    Like so:
    Please Login or Register  to view this content.

    As you can see we're testing the first 3 letters of each cell. You can expand this as much as you wish by adjusting the red values, or adding to the lists as shown.
    Last edited by JBeaucaire; 01-15-2010 at 05:24 PM. Reason: corrected REPLACE() code for added sections

  8. #8
    Registered User
    Join Date
    01-15-2010
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Formatting data in Excel

    ahhh thats brilliant!, thanks to both of you

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formatting data in Excel

    I corrected an error in the added sections above, be sure to get the corrected code.

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].

+ 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