+ Reply to Thread
Results 1 to 4 of 4

Conditional formatting - cells that contain *

  1. #1
    Registered User
    Join Date
    01-12-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    97

    Conditional formatting - cells that contain *

    I'm hoping I didn't use a character that isn't possible to do this.

    Column A I have Texas*

    Columns B, C and D contain numbers. I wan't to fill in these columns a color if Column A contains a * but I can't get it to work.

    Thanks

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Conditional formatting - cells that contain *

    hi kufta4, select the range you want to apply to (say from A2:A10)
    in Excel 2007 & above, go to Home -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format -> Format values where this formula is true:
    =COUNTIF($A2,"*~**")

    format the color desired. Then press OK.

    to explain, "*" is a wildcard. if you use this below, you are looking for ANY kind of text.
    =COUNTIF($A2,"*")

    "~" is a character to tell excel that the next character is a literal character you wish to find. that makes "*" on the right of it no longer a wildcard. but note that this is like finding if A2 IS EQUALS to "*".
    =COUNTIF($A2,"~*")

    to find whether A2 CONTAINS "*", add in 2 wildcards in front and behind.
    =COUNTIF($A2,"*~**")
    Attached Files Attached Files
    Last edited by benishiryo; 04-09-2017 at 09:12 PM. Reason: added in explanation

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    07-14-2013
    Location
    USA
    MS-Off Ver
    MS 365
    Posts
    97

    Re: Conditional formatting - cells that contain *

    Try this: highlight the cells you want to conditional format, go to conditional formatting, highlight cell rules, text that contains ~*, then choose your highlight color. That little symbol is the tilde on the key next to the number 1.

  4. #4
    Registered User
    Join Date
    01-12-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    97

    Re: Conditional formatting - cells that contain *

    Quote Originally Posted by benishiryo View Post
    hi kufta4, select the range you want to apply to (say from A2:A10)
    in Excel 2007 & above, go to Home -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format -> Format values where this formula is true:
    =COUNTIF($A2,"*~**")

    format the color desired. Then press OK.

    to explain, "*" is a wildcard. if you use this below, you are looking for ANY kind of text.
    =COUNTIF($A2,"*")

    "~" is a character to tell excel that the next character is a literal character you wish to find. that makes "*" on the right of it no longer a wildcard. but note that this is like finding if A2 IS EQUALS to "*".
    =COUNTIF($A2,"~*")

    to find whether A2 CONTAINS "*", add in 2 wildcards in front and behind.
    =COUNTIF($A2,"*~**")
    I ended up using the this cell contains option and did the ~* to highlight Texas* instead of the numbers. I couldn't seem to get that to work but highlighting Texas* honestly does enough. Thanks for the help.

+ 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. Replies: 1
    Last Post: 10-04-2016, 05:17 AM
  2. Conditional Formatting - Color Formatting for Blank Cells
    By mlbdc2012 in forum Excel General
    Replies: 10
    Last Post: 02-10-2015, 06:28 AM
  3. Replies: 2
    Last Post: 12-05-2014, 07:15 AM
  4. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  5. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  6. Replies: 2
    Last Post: 09-19-2013, 10:34 AM
  7. Replies: 3
    Last Post: 05-15-2012, 04:13 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