+ Reply to Thread
Results 1 to 11 of 11

Conditional formatting based on search of partial text column

  1. #1
    Registered User
    Join Date
    11-21-2015
    Location
    Stafford
    MS-Off Ver
    2010
    Posts
    7

    Conditional formatting based on search of partial text column

    I have a list of partial text of names of clients, for example.

    John
    Smith
    Peters

    I want to conditional format another column if any of these partial matches are found.

    John David
    Lesley Craig
    Brian Smith
    Arnold Palmer
    Linda Paul
    Shelly Johns
    Thomas Peters
    Brenda Young

    Any help with this would be greatly appreciated!

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,926

    Re: Conditional formatting based on search of partial text column

    Are you wanting this to be dynamic? In other words, do you want to be able to change the names you are looking for?
    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
    11-21-2015
    Location
    Stafford
    MS-Off Ver
    2010
    Posts
    7

    Re: Conditional formatting based on search of partial text column

    Yes, AliGW, the list can expand too, it might be one partial name, it might be 50 or more.

  4. #4
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,926

    Re: Conditional formatting based on search of partial text column

    If you don't need it to be dynamic, then create three new rules using the Format cells that contain ... option in the CF dialog, and choose Specific text from the drop-down list at the bottom.

  5. #5
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,926

    Re: Conditional formatting based on search of partial text column

    Quote Originally Posted by SirBrock View Post
    Yes, AliGW, the list can expand too, it might be one partial name, it might be 50 or more.
    Then I am afraid that you are going to need to, er, 'expand' on your requirement. Can you explain in more detail?

  6. #6
    Registered User
    Join Date
    11-21-2015
    Location
    Stafford
    MS-Off Ver
    2010
    Posts
    7

    Re: Conditional formatting based on search of partial text column

    I have a column where I want to be able to enter partial names of clients. This column can be any size, but won't likely be more than 100.

    I have another column of clients, which is also dynamically generated.

    I want to use the list of partial names to apply conditional formatting to each client.

    If the partial list is John, Clare, Sofia, Dominic, and the client's full name is John Smith, it will highlight that cell in red. If the name was Craig Anderson, then it would have no formatting.

    I hope this helps.

  7. #7
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,926

    Re: Conditional formatting based on search of partial text column

    Eek!

    This is going to require quite a complicated CF formula, methinks. I shall have a ponder! Maybe one of the gurus here will be able to solve it immediately. Thanks for the clarification!

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Conditional formatting based on search of partial text column

    With the list of partial names in M1:M3, and main list in column A, starting in A2, try this formula for the cf rule.

    =OR(ISNUMBER(SEARCH(M$1:M$3,A2)))

  9. #9
    Registered User
    Join Date
    11-21-2015
    Location
    Stafford
    MS-Off Ver
    2010
    Posts
    7

    Re: Conditional formatting based on search of partial text column

    =OR(ISNUMBER(SEARCH(E$2:E$1000,G2)))

    How can I tell it to ignore an empty cell in the E$2:E$1000 data? It is causing it to be constantly true.

  10. #10
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Conditional formatting based on search of partial text column

    As long as the empty cells are at the end of the list,

    =OR(ISNUMBER(SEARCH(E$2:INDEX(E:E,MATCH("ZZZ",E:E)),G2)))

    Should work.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Conditional formatting based on search of partial text column

    Try this...

    Data Range
    A
    B
    C
    1
    John David
    ------
    John
    2
    Lesley Craig
    Smith
    3
    Peters
    4
    Brian Smith
    5
    Arnold Palmer
    6
    Linda Paul
    7
    8
    Shelly Johns
    9
    Thomas Peters
    10
    Brenda Young


    Select the entire range A1:A10.

    Conditional formatting...

    Formula:

    =SUM(COUNTIF(A1,"*"&C$1:C$3&"*"))

    If you test that formula in worksheet cells it must be array entered.

    Array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Last edited by Tony Valko; 12-12-2015 at 09:52 AM.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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] Conditional Formatting based on partial/specific text to highlight entire row
    By bizdevdfw in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-18-2016, 04:32 PM
  2. [SOLVED] Conditional Formatting Partial Currency Values in One Column
    By bmann021 in forum Excel General
    Replies: 9
    Last Post: 08-27-2015, 11:40 AM
  3. Replies: 11
    Last Post: 02-04-2015, 01:34 PM
  4. [SOLVED] Partial conditional formatting based on the colour of a cell
    By ello2001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-07-2014, 08:17 AM
  5. Search and copy based on partial text match
    By PIQalap in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2014, 11:36 AM
  6. [SOLVED] Conditional formating based on text in 2 columns (but only partial text!)
    By Icehockey44 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-19-2012, 06:26 AM
  7. conditional formatting based on a series of column text values
    By stewphil in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-19-2012, 03:34 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