+ Reply to Thread
Results 1 to 15 of 15

Extract Words for a cell

  1. #1
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Extract Words for a cell

    Hi

    Could someone please help.

    Is there a way to get them two sentences to shows just the words Small in one cell then Natural Wood in another cell
    And then Large in one cell then natural wood in another cell?

    Would you like your pegs painted?:No all natural wood please | Size:Small 3 x Peg - £45
    Would you like your pegs painted?:No all natural wood please | Size:Large 5 x Peg - £105

    I can only get it to say Small 3 x Peg - £45

    Many Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,730

    Re: Extract Words for a cell

    You can get the size using this formula in C2:

    =MID(A2,FIND("Size",A2)+5,5)

    then copy down.

    You will need to give us some more examples of your data to show some variation if the answer to the question is "Yes" - how do you show the colour in these case?

    Hope this helps.

    Pete

  3. #3
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070

    Re: Extract Words for a cell

    Hi,

    It would seem your attached file is corrupted ...

    Could you make a second attempt ...
    HTH
    Carim


    Top Excel Links

  4. #4
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: Extract Words for a cell

    This is the full piece in trying to organise, just thinking if i can get the above working for now that would help.

    Im not 100% if i have uploaded the correct file type.
    Attached Files Attached Files

  5. #5
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070

    Re: Extract Words for a cell

    Hi,

    In cell C2, you can have

    =IFERROR(TRIM(MID(A2,SEARCH(C$1,A2)+5,6)),"")

    then copy down ...

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,730

    Re: Extract Words for a cell

    Change the formula in C2 to this:

    =IFERROR(MID(A2,FIND("Size",A2)+5,6),"")

    then copy down by double-clicking the fill handle (the small black square in the bottom-right corner of the cursor, with C2 selected).

    Hope this helps.

    Pete

  7. #7
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: Extract Words for a cell

    oh wow they seem to work great


    thank you so much

  8. #8
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070

    Re: Extract Words for a cell

    Glad you could fix your problem

    Thanks for your Thanks

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,730

    Re: Extract Words for a cell

    The data in column A seems too variable to be able to extract the colour reliably.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    You might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  10. #10
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: Extract Words for a cell

    Im trying to figure out how this formula actually works.... is there a way to edit it as i please?

    for example

    Would you like your pegs painted?:No all natural wood please | Size:Small 3 x Peg - £45

    I would only like it to pick up Natural Wood.

    Or will it require a totally new formula?

  11. #11
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070

    Re: Extract Words for a cell

    It seems to me you are not longer focusing on Column C ... But on Column E ...

    Is that right ?

  12. #12
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: Extract Words for a cell

    i am now, yes.

    i was just wondering if that formula was easily editable.

    No worries if not.

  13. #13
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,730

    Re: Extract Words for a cell

    It might be possible to list all your colours (plus "natural wood") in a column somewhere and then you could look to see if any of the colours can be found with the text in column A and return that colour to column E.

    Hope this helps.

    Pete

  14. #14
    Forum Contributor
    Join Date
    08-11-2013
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    270

    Re: Extract Words for a cell

    that might be a shout. cheers

  15. #15
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,730

    Re: Extract Words for a cell

    OK, this doesn't quite work where you have multiple colours in the same cell in column A (see below), but I put this list of colours in column H from H1 down:

    Natural wood
    Light Grey
    Dusty Pink
    Lavender
    Light Blue
    Yellow
    Orange
    Blue
    Teal
    Graphite
    Bright Pink
    Sage
    Olive
    Rust
    White

    which I obtained manually by examining what you had in the cells in column A. Then you can use this array* formula in cell E2:

    =IFERROR(INDEX($H$1:$H$15,MAX(IF(ISNUMBER(SEARCH($H$1:$H$15,A2)),ROW($H$1:$H$15),-1))),"")

    *Note that an array formula needs to be committed using the key combination of Ctrl-Shift-Enter, rather than the usual Enter.

    This can then be copied down as required.

    Note that it only picks out one of the colours shown in cell A4 - actually, it is the colour which is furthest down the list, because of the MAX function.

    Hope this helps.

    Pete

    P.S. I see that your profile is out of date, as you would not be able to get the earlier formulae working in Excel 2003, so please update it in your User CP.

+ 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. [SOLVED] Extract one of five words from one cell into another
    By M12NIX in forum Excel General
    Replies: 6
    Last Post: 01-25-2017, 08:41 PM
  2. How to extract first 3 words from another cell
    By papusale in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-03-2015, 08:53 AM
  3. Need to extract last 4 words from a cell
    By DrFistington in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-13-2014, 05:12 PM
  4. [SOLVED] extract last 2 words of cell
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-26-2014, 04:09 PM
  5. Replies: 7
    Last Post: 02-25-2014, 02:00 AM
  6. [SOLVED] Extract first two words of a cell
    By letangerang58 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-05-2013, 01:12 PM
  7. Extract particular words from a cell
    By DeepakS in forum Excel General
    Replies: 2
    Last Post: 08-22-2011, 08:58 AM

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