+ Reply to Thread
Results 1 to 5 of 5

problem with using asterisk as wildcard in conditional formatting

  1. #1
    Registered User
    Join Date
    06-01-2012
    Location
    Swarthmore, PA, USA
    MS-Off Ver
    Excel:mac 2011
    Posts
    14

    problem with using asterisk as wildcard in conditional formatting

    Hey all,

    I'm currently working on a sheet where I'm using conditional formatting to shade an entire row where the color of the shading is determined by text in one of the columns (e.g. if the row has "cash" in the E column the row goes yellow, whereas if the row has "check" in the E column the row goes green). My problem arises when I attempt to use the * to account for other characters. Since sometimes I have text in the E column like "cash (just received)" I want to include that in the conditional shading. I've used the asterisk as a wildcard before for SUMIF functions and it has worked great, but for some reason when I change the conditional formatting formula to try to catch all the cells with the string "cash" anywhere in the cell (so I enter "*cash*" for what it is looking for) it isn't working and shades none of the rows, even the ones that have only "cash" in the E column and no extra characters. I know I could use the ISNUMBER and SEARCH functions but I'm stubborn and very stumped as to why the asterisk worked for my SUMIF's in (what I think is) the exact same way I am attempting to use it here.

    Thanks in advance for any help. I'm using Excel 2011 for mac.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: problem with using asterisk as wildcard in conditional formatting

    HI nsterng1,

    See the attached file where I have applied the conditional formatting when word "cash" is found in the column, the entire row turns as yellow :-
    conditional formatting - cash.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    06-01-2012
    Location
    Swarthmore, PA, USA
    MS-Off Ver
    Excel:mac 2011
    Posts
    14

    Re: problem with using asterisk as wildcard in conditional formatting

    Thanks for the response dilipandey, but if you look at the end of my post I do know that the ISNUMBER and SEARCH functions provide a way to do this, I was just curious as to why the asterisk was seemingly working well when using the SUMIF yet wasn't when attempting to use it in the same way with the conditional formatting formula. That is what is really getting me.

    Thanks again, though.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: problem with using asterisk as wildcard in conditional formatting

    Not all functions/operators recognise wildcards. If you use a formula like

    =A1="*cash*"

    ...then that will only return TRUE if A1 literally contains the text *cash* (i.e. the asterisks are treated as text not wildcards). If you want to use a wildcard in your conditional formatting you can use COUNTIF like this

    =COUNTIF($C3,"*cash*")

    or SEARCH on its own, (without ISNUMBER) will also work, i.e.

    =SEARCH("cash",$C3)
    Audere est facere

  5. #5
    Registered User
    Join Date
    06-01-2012
    Location
    Swarthmore, PA, USA
    MS-Off Ver
    Excel:mac 2011
    Posts
    14

    Re: problem with using asterisk as wildcard in conditional formatting

    Ahhhh great, thanks very much daddylonglegs. That's what I was looking for.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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