+ Reply to Thread
Results 1 to 5 of 5

AND is not working with conditional formatting

  1. #1
    Registered User
    Join Date
    02-18-2015
    Location
    Portland, OR
    MS-Off Ver
    Office 2013
    Posts
    2

    AND is not working with conditional formatting

    Hello All,

    I am trying to do some conditional formatting based on multiple conditions. I need to quickly see if students are on level based on their grade level and placement score. However their "placement" is also conditional to their grade level. i.e. if a 1st and 2nd grader get the same score on the placement test they will be placed at different levels. The formula I have been using is =IF(AND($E3=1,$H3>=$N$4),"1Green"). Where Column E is their grade level, Column H is their score on the test, and N4 is the minimum cut off for placement in their current grade (I chose not to put an actual number for for N4 because the cut off scores may change in the future) I know this formula works in the actual sheet because I have tested it on cells matching the criteria (it returns 1Green for true and false for false). However, when I put it in conditional formatting it doesn't work. I have tried to modify it in many different ways to make it work, but I am just not savvy enough. Can someone help me, please?

    I have attached a worksheet. It looks a bit weird because I have removed the identifying information for the students, but kept the formulas intact. The table on the right is the range of cut off scores (grade"x" is their grade level when taking the test and the Level"x" is their placement based on their score) There are some blanks where students have not taken the test, I would like those to stay blank. As you will see I have separate formulas for 1st through 12th grade and whether they are on grade or above (green), one level below(yellow) or two or more levels below(red). Eventually I will need all of these to go into conditional formatting, but if I can figure out why it won't work on the previously specified formula, I can apply it to the rest of them myself. I am sure it's something simple I'm not seeing. Thanks in advance for any help!
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: AND is not working with conditional formatting

    Hi and welcome to the forum!

    I'm not quite sure where I'm supposed to be looking in this sheet, though it might be of general help to you to point out that, within Conditional Formatting, the use of an IF clause is largely superfluous.

    A formula-based CF rule is one in which, if the statement entered for that rule is TRUE, the formatting is applied; if that statement is FALSE, it isn't.

    =AND($E3=1,$H3>=$N$4)

    is such a (sufficient) statement (without the need for an IF clause), since it will evaluate to either TRUE or FALSE.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: AND is not working with conditional formatting

    With conditional formatting the IF is implied - you need to rework the formula as a logical expression which will return TRUE (to trigger the change in format) or FALSE. So, you will select the cells that you want the format to apply to (or you could just select one cell and then use the Format Painter to apply that format to other cells afterwards), and then click on Conditional Formatting | New Rule | Use a Formula... from the bottom of the list, and then use this formula in the dialogue box:

    =AND($E3=1,$H3>=$N$4)

    Click on the Format button | Fill tab and choose Green, then OK your way out.

    Hope this helps.

    Pete

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: AND is not working with conditional formatting

    Okay, there are a number of things wrong with this. We'll start with the formula first.
    =IF(AND(E3=1,H3>=N4),"1Green", Nothing)
    I assume, that if it meets those conditions, then you want the green formatting?
    You do not need to use an IF statement. It is automatically looking for a TRUE/FALSE for your conditions so this can be shortened to

    =AND(E3=1, H3>N4)
    If that's true, it'll turn Green, if not, it won't.

    Next:
    You have this formula set up for all of Column I. When you set up a conditional format formula, you set it up as you would for the first cell in your range and then Excel sequentially increments the cells unless you have them anchored with a $. So, for cell I3 for example, Excel asks itself this question

    Is E5 = to 1 and H5 greater than N6? IF so, I3 will turn Green.
    I do not think that is your intention.

    So based on your post, I suspect you want Range I:I with this conditional format

    =AND($E1=1, $H1>$N$4)
    Last edited by ChemistB; 02-18-2015 at 05:24 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    02-18-2015
    Location
    Portland, OR
    MS-Off Ver
    Office 2013
    Posts
    2

    Re: AND is not working with conditional formatting

    Perfect! Thank you!

+ 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. Conditional formatting not working
    By Marcel Coetzee in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-07-2014, 05:35 PM
  2. Conditional formatting not working
    By michmat120 in forum Excel General
    Replies: 3
    Last Post: 12-13-2013, 04:16 PM
  3. Conditional Formatting is not working
    By rengrish in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2012, 01:23 AM
  4. Conditional Formatting not Working
    By braydon16 in forum Excel General
    Replies: 7
    Last Post: 05-23-2012, 02:41 PM
  5. VBA conditional formatting not working
    By LarryC in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-26-2008, 09:43 AM

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