+ Reply to Thread
Results 1 to 8 of 8

Conditional Formatting Question

  1. #1
    Registered User
    Join Date
    05-07-2009
    Location
    Belfast, N.Ireland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Conditional Formatting Question

    Hi all, am hoping someone can help with a excel formatting issue.

    I need to set up some conditional formatting on my spreadsheet, however I am having a little trouble with one of my conditions.

    The requirement is:
    - if a cell value in column X contains the word "open", format row background to yellow.
    - if a cell value in column X contains the word "resolved", format row background to green.
    - if a cell value in column X contains the word "moved" OR "closed", format row background to blue.

    Now I have manged the first two on my own, using the conditional formatting tool and using the formula "=SEARCH("open",INDIRECT("X"&ROW()))".

    However I am stuck on the last one. I tried...

    =OR(SEARCH("resolved",INDIRECT("X"&ROW())), SEARCH("closed",INDIRECT("X"&ROW())))

    However this doesnt work. I tried looking at adding VB script in but to be honest I am not a VB programmer and cant really spend too much time on this. Any suggestions to fix the final conditional format so it run if the cell contains either "resolved" or "closed"?

    Thanks for any and all help.

    Dave
    Last edited by Dave_NI; 05-07-2009 at 10:55 AM. Reason: Solved

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Conditional Formatting Question

    =OR(ISNUMBER(SEARCH("resolved",x1)),ISNUMBER(SEARCH("closed",x1)))
    whats with the indirect?
    no need if that is entered in conditional format cell x1 then you copy format to another cell x2 it will self adjust
    Last edited by martindwilson; 05-07-2009 at 09:14 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: Conditional Formatting Question

    Using SEARCH implies that "Closed" or "Resolved" might be amongst other text, in which case you could use this formula in conditional formatting

    =COUNTIF(X1,"*resolved*")+COUNTIF(X1,"*closed*")

    If "Closed" or "Resolved" would be the only word in the cell then the above would work but you only need

    =OR(X1="Closed,"X1="Resolved")

  4. #4
    Registered User
    Join Date
    05-07-2009
    Location
    Belfast, N.Ireland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Conditional Formatting Question

    Hi martin, thanks for the quick feedback.

    I used the indirect function as seen it in another example online. I am applying the formatting to all cells at the same time (Ctrl & A before selecting conditional formatting) so it worked well for me.

    I have attached a working example, as you can see the closed rows are blue but I need to get the moved rows to change as well...

    Appologies if I am missig something, I have very little experince with this sort of thing.

    Thanks

    Dave
    Attached Files Attached Files

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

    Re: Conditional Formatting Question

    If you select the whole sheet you can use these conditions

    =SEARCH("open",$X2)

    =SEARCH("resolved",$X2)

    =COUNTIF($x1,"*closed*")+COUNTIF($x1,"*moved*")

    Note the $ which ensures that formatting is applied to the whole row, see attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-07-2009
    Location
    Belfast, N.Ireland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Conditional Formatting Question

    Yip, thats it! Thats Daddy... and Martin for your input.

    Daddy your solution works fine, thanks.

    For the record I was also able to update my own formula based on your suggestion (in case anyone finds it useful)...

    =COUNTIF(INDIRECT("X"&ROW()),"*closed*")+COUNTIF(INDIRECT("X"&ROW()),"*moved*")

    However I stuck with your suggestion.

    Either way works, so I am happy. Thanks.

  7. #7
    Registered User
    Join Date
    04-22-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Conditional Formatting Question

    How can i do this
    A1 has the word SUNDAY, if today's date is SUNDAY then A2 should return the word TODAY

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Conditional Formatting Question

    sammeh please start a new thread with your question, forum rules do not allow starting a new thread within an existing thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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