+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 25

Thread: How to copy specific information from a cell with a lot of text to a separate cell.

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    Sandefjord, Norway
    MS-Off Ver
    Excel 2007
    Posts
    13

    Smile How to copy specific information from a cell with a lot of text to a separate cell.

    Hi all,

    my problem is this:

    1'st I'm an Excel noob, haven't really used any advanced features.

    2'nd I need to copy specific information from a cell that has a lot of other text that's not needed in it.

    3'rd This has to be done several thousand times.

    f.ex. I've got a thousands of cells with: "Product name, compatability, product number, product dimensions, product specifications". How do I copy "compatability" on all these to a separate cell for each of the "compatability" automatically? I guess I'll have to use a macro, but does anybody know how I should code this?

    Would greatly appreciate any help.

    Best regards
    Thomas.
    Last edited by vikingim; 01-18-2012 at 01:54 AM.

  2. #2
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,195

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    I guess I'll have to use a macro
    Not necessarily. Please post a sample with some typical examples and indicate what you need to extract and what "rules", if any, apply.


    Regards, TMS

  3. #3
    Registered User
    Join Date
    01-12-2012
    Location
    Sandefjord, Norway
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    Hi TMS,

    thank you for your fast response.


    Here's a typical example of the content in one cell: produkt 226390 Barracuda Karizzma - 7,5x17" 4x108 - ET25 (73,1) - Mattsortpol. med valgfri kantfarge

    What I need to extract here is 4x108 and get it in a separate cell and automation of the whole process on all rows.

    I hope I've explained it good enough. hehe.

    Thomas.

  4. #4
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,195

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    and what "rules", if any, apply
    So, not quite. How would someone, other than yourself, determine where the data you want to extract starts and ends? It doesn't really matter if the data is extracted with a formula or VBA ... it is still essential to know those details, that is, the "rules". I'm not familiar with the Norwegian language so the words don't tell me anything.

    Regards, TMS
    Last edited by TMShucks; 01-12-2012 at 09:36 AM.

  5. #5
    Registered User
    Join Date
    01-12-2012
    Location
    Sandefjord, Norway
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    The only "rule" I can think of, is that I know the data to be extracted is in this case "4x108".
    I'm probably as familiar with what excel can or can not do as you are with the Norwegian language, so please don't shoot me for being ignorant. lol.

    Thomas.

  6. #6
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,195

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    I'm not shooting you for your ignorance of Excel. I'm just explaining that I, and others, need to go within the string to extract the data. You know why you're looking for 4x108. Why? Is there always a double quote and a space before it? Is there always a space hyphen space after it?

    If it is, this works (at least, for this specific example):

    =MID(A2,FIND(""" ",A2)+2,FIND(" - ",A2,FIND(""" ",A2))-FIND(""" ",A2)-1)

    If you were to tell me to come visit you, but didn't tell me your address ... country, city, road, house number ... I wouldn't know how to get there. I need some guidance.


    Regards, TMS

  7. #7
    Registered User
    Join Date
    01-12-2012
    Location
    Sandefjord, Norway
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    The reason I know I'm looking for 4x108 isn't in the string as far as I see it, other than that I know it's 4x108 I'm looking for.
    Isn't it possible to do a search for 4x108 and copy it to the cell next to the row it's extracted from?
    I'm sorry if my explanation and understanding of it is bad.

    Thomas.

  8. #8
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,222

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    If your "compatibility string" was consistent in some manner, this would be easier. Perhaps you have a set list of all the possible compatibility strings, and its only 5-10 options? If so, you can list those in a column for reference to help. So over in column Z put your list:

    4x108
    5x109
    4x200
    2x75



    Then for the string in A2, put this formula in B2:

    =LOOKUP(2, 1/(--(ISNUMBER(SEARCH($Z$1:$Z$4, A2)))), $Z$1:$Z$4)
    _________________
    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!)

  9. #9
    Registered User
    Join Date
    01-12-2012
    Location
    Sandefjord, Norway
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    Hi JBeaucaire,

    Your suggestion looks reasonable to me.
    I've tried doing as you said, but I get an error when trying to save the formula in the cell.
    The error is "error in the formula" or something similar to that.
    I have a Norwegian version of Excel so I had to translate it. :P
    I've also tried translating the formula to Norwegian, but there's still the same error.

    Thanks for your help, I greatly appreciate it.

    Thomas.
    Last edited by vikingim; 01-16-2012 at 03:51 AM.

  10. #10
    Registered User
    Join Date
    01-12-2012
    Location
    Sandefjord, Norway
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    Here's a screenshot from one of the sheets I need it on, I hope it clarifies things a bit.
    excel1.gif

    Thanks,
    Thomas.

  11. #11
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,222

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    Why screenshots? Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.
    _________________
    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!)

  12. #12
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,222

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    Based on the picture, the formula to get the string from C2 would be:

    =LOOKUP(2, 1/(--(ISNUMBER(SEARCH($H$2:$H$11, C2)))), $H$2:$H$11)
    _________________
    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!)

  13. #13
    Registered User
    Join Date
    01-12-2012
    Location
    Sandefjord, Norway
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    That's what I thought as well, but I've tried both Norwegian and english version of the commands, but still get the error message. I've double checked the norwegian equalents to the LOOKUP, ISNUMBER and SEARCH commands. I have no idea why it doesn't work. I guess it would have worked if I had the english version though. lol.

  14. #14
    Registered User
    Join Date
    01-12-2012
    Location
    Sandefjord, Norway
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    Quote Originally Posted by JBeaucaire View Post
    Why screenshots? Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.
    Here's the workbook.

    eksperimentark1.xlsx

  15. #15
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,222

    Re: How to copy specific information from a cell with a lot of text to a separate cel

    No, there's nothing country specific about that formula other than the commas vs semicolons.

    I added a named range called CODES to this worksheet. (Ctrl-F3 to see it) This named range will expand itself as you add/delete items from the H column. Ths changed the formula to:

    =LOOKUP(2, 1/(--(ISNUMBER(SEARCH(Codes, C2)))), Codes)


    ....which I put into E2, works fine.
    Attached Files Attached Files
    _________________
    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!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0