+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    03-05-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    58

    Conditional Formatting AND/IF formula?

    I have 2 colums of data, A and B. Both columns contain text of either "yes" or "no". I need to format column B to fill color based on these parameters:

    RED if A="yes" and B="no"
    GREEN if A="no" and B="yes"


    Help!? Thanks in advance.
    Last edited by JuJuBe; 03-05-2010 at 11:14 AM.

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,153

    Re: Conditional Formatting AND/IF formula?

    Select range in column B and go to Home tab, Conditional Formatting, Manage Rules

    Select use formulas to determine which cells to format...

    then enter formula:

    =AND(A1="yes",B1="no")

    click Format and choose from Pattern tab

    Click Ok.

    Click New Rule

    use same rule but with formula:

    =AND(A1="no",B1="yes")

    add select Green from Pattern tab

    Click Ok

    Click Ok / Apply

    Note: Assumption is you are starting at B1... if you are starting lower, change A1 and B1 in formula to correspond to top row you selected to test.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    03-05-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    58

    Re: Conditional Formatting AND/IF formula?

    Thanks NBVC. I did that and had a problem when I selected and formatted the entire range. I didn't have "$" in the formula, I'm not sure what my problem was. Anyway, I tried again by only selecting and formatting B2, then copying and paste special as formats to the rest of the range and it worked. Thanks a ton for the help!

    JuJuBe

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.2.0