+ Reply to Thread
Results 1 to 6 of 6

Formula for conditional formatting based on any of multiple text strings?

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2011
    Posts
    6

    Formula for conditional formatting based on any of multiple text strings?

    Columns H through K contain codes: reg, f, s, b, h, j

    All of these codes fall into one of a few colors:
    reg, h = red
    s, b, j = blue
    f = pink

    Is is possible to write one conditional formatting rule to turn the cells containing "s", "b","j" blue (or all the 'reg', 'h' cells red) or do I need a rule for each string? I CANNOT get an OR() formula to do the job, but I feel like it should work.

    Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Formula for conditional formatting based on any of multiple text strings?

    klenatron, maybe you're including an "IF" in your CF formula? Anyway, you can use one OR formula per set of characters - please see attached.
    Attached Files Attached Files
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2011
    Posts
    6

    Re: Formula for conditional formatting based on any of multiple text strings?

    I actually just figured it out and this confirms exactly what I did. I was forgetting that it would extrapolate all the cells if you start with the first in the desired range so I was trying to include a range in my OR() formula. Dumb!

    Thanks!

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Formula for conditional formatting based on any of multiple text strings?

    I Think.. Its not possible...

    CF only checks TRUE Value, It never set If True then Red else Blue..

    However.. you can do a trick.. set actual color of all cells to Blue.. and if any condition matched the set it to Red..

    BTW.. you always have option to set multiple CF & set Preference..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  5. #5
    Registered User
    Join Date
    06-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2011
    Posts
    6

    Re: Formula for conditional formatting based on any of multiple text strings?

    Debraj Roy - Thanks, but I did manage to do what I was asking for. I'm not following your reply fully, but I wasn't looking for one color or the other, so I'm all set.

  6. #6
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Formula for conditional formatting based on any of multiple text strings?

    klenatron, glad you're sorted, and thanks for the rep

+ 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