+ Reply to Thread
Results 1 to 7 of 7

Conditional Formatting with multiple rules

  1. #1
    Registered User
    Join Date
    06-30-2011
    Location
    Hobart, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Conditional Formatting with multiple rules

    Hi,

    I'm trying to use conditional formatting to flag an entire row based on the values in two cells in different columns.
    Based on the value in column F (Y or N) I can get the row to be flagged as red or green respectively by using the INDIRECT function.
    What I want to do is to flag the row as a different colour if the value in column F=Y and the value in column G=N. The only way I can figure out how to do this will also change the row colour even if column F=N which isn't what I want.
    Basically I want the row colour to be dependent on values in both F and G rather than independent.

    Any help will be greatly appreciated!

  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 with multiple rules

    formula is option of
    =and(f1="y",g1="n")
    "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
    Registered User
    Join Date
    06-30-2011
    Location
    Hobart, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Conditional Formatting with multiple rules

    This doesn't seem to work as I am trying to apply the formatting to the entire row, not just a single cell.

  4. #4
    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 with multiple rules

    use absolute references
    =and($f$1="y",$g$1="n")
    you can copy that along the row
    Last edited by martindwilson; 07-01-2011 at 03:29 AM.

  5. #5
    Registered User
    Join Date
    05-13-2011
    Location
    New Zealander in London
    MS-Off Ver
    Excel 2007
    Posts
    74

    Re: Conditional Formatting with multiple rules

    Martin is nearly spot on, you want to use the formula =AND($F1="y",$G1="n") in your conditional formatting. In this way Excel will increment the row, but not the column, so you can apply this conditional formatting to an entire row with it still looking in columns F and G.

  6. #6
    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 with multiple rules

    yep thats right .. my bad if you used as i put it it would onlt ref row 1!
    im also intrigued by the use of indirect ,how are you using that?

  7. #7
    Registered User
    Join Date
    06-30-2011
    Location
    Hobart, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Conditional Formatting with multiple rules

    That's working now, thanks for the help!

    What I had with the indirect function was:

    =INDIRECT("F"&ROW())="N"

+ 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