+ Reply to Thread
Results 1 to 10 of 10

Extract Colours From String

  1. #1
    Registered User
    Join Date
    09-03-2010
    Location
    London, England
    MS-Off Ver
    MS EXCEL 365 (v. 2111)
    Posts
    41

    Extract Colours From String

    Hi All, I hope you can help me.

    I have a list of products names which contain the colour of the item and then the description. For example "Redddish Brown Tile". What I want to be able to do is to split the item description into the product colour and the product name. So (column 1) Reddish Brown | (column 2) Tile

    I have attached the list and listed the colours on the second sheet.

    Any help would be greatly appreciated!

    Thanks, James
    Attached Files Attached Files
    Last edited by jamesjhhill; 02-18-2021 at 08:22 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,162

    Re: Extract Colours From String

    Please mock up the results you want manually for 20-30 rows.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-03-2010
    Location
    London, England
    MS-Off Ver
    MS EXCEL 365 (v. 2111)
    Posts
    41

    Re: Extract Colours From String

    I have just uploaded a second version called Help (Mockup) which has the desired result. Many Thanks!

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,322

    Re: Extract Colours From String

    Now you have shown the easy ones, what do you expect for the hard ones at the end of the list.
    torachan.

  5. #5
    Registered User
    Join Date
    09-03-2010
    Location
    London, England
    MS-Off Ver
    MS EXCEL 365 (v. 2111)
    Posts
    41

    Re: Extract Colours From String

    Firstly, I'm glad you think the first ones are easy! . . . that give's me hope . I've uploaded a third sheet called 'Help (Mockup + HARD)'. Essentially those 5-10 items at the end have no applicable colour so can just be ignored

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,398

    Re: Extract Colours From String

    Your list of colours must have been downloaded from the web. Each colour had a non-printing paragraph break (CHAR160) after it.

    So...

    1. Colours, C2, copied down:

    =SUBSTITUTE(B2,CHAR(160),"")

    Copy and paste values BACK over column B. I have done this for you already.

    2. List, B2, copied down:
    =IFERROR(LOOKUP(1000,SEARCH(Colours!$B$1:$B$190,A2),Colours!$B$1:$B$190),"")

    3. List C2, copied down:
    =TRIM(SUBSTITUTE(A2,B2,""))

    see file.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,398

    Re: Extract Colours From String

    Jameshill... if you modify and upload a new sheet, do so in a NEW post inthe SAME thread. Do not retrospectively edit the attachment at Post 1 if you have already received replies. It makes everything so difficult to follow.

    I have not yet looked at your newest attachment. I'll wait to see how my first reply pans out.

  8. #8
    Registered User
    Join Date
    09-03-2010
    Location
    London, England
    MS-Off Ver
    MS EXCEL 365 (v. 2111)
    Posts
    41

    Re: Extract Colours From String

    Thanks Glenn, that solution works perfectly. Sorry for uploading to original post - I couldn't see a way to attach to the same thread. I'll make sure I do that in future! Thanks aging - it works great!

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,162

    Re: Extract Colours From String

    No need to copy and paste anything with my solution.

    B2:

    =LOOKUP(1000,SEARCH(SUBSTITUTE(Colours!$B$1:$B$190,CHAR(160),""),CLEAN(A2)),SUBSTITUTE(Colours!$B$1:$B$190,CHAR(160),""))

    C2:

    =TRIM(SUBSTITUTE(A2,B2,""))
    Attached Files Attached Files
    Last edited by AliGW; 02-18-2021 at 08:44 AM.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,398

    Re: Extract Colours From String

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

+ 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] Formula to search a range for a string and then extract certain dta from string
    By gratedane8 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-08-2018, 06:09 PM
  2. String characters with various colours
    By Un-Do Re-Do in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-03-2017, 08:23 AM
  3. [SOLVED] extract multi-letter string bits from string depending on size and case
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-18-2017, 10:41 PM
  4. [SOLVED] Extract all the words from a string for processing, while leaving string intact.
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-10-2014, 02:02 PM
  5. [SOLVED] Changing colours of Part of string
    By dhiresh in forum Excel General
    Replies: 10
    Last Post: 03-04-2013, 05:31 AM
  6. [SOLVED] Changing colours of certain words in string
    By dhiresh in forum Excel General
    Replies: 3
    Last Post: 02-22-2013, 08:11 AM
  7. [SOLVED] Extract a mainly numeric string (ISSN number) from an arbitrary string
    By Buzzed Aldrin in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-04-2012, 01:49 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