+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : AND doesn't work in Conditional Formatting

  1. #1
    Registered User
    Join Date
    03-21-2012
    Location
    Prescott, AZ
    MS-Off Ver
    Excel 2007
    Posts
    1

    Cool AND doesn't work in Conditional Formatting

    I am trying to use conditionally format row of cells if the value of the cell in column A is between 1 and 5 but not blank. The simple expression,

    =INDIRECT("A"&TEXT(ROW(),"0"))<=5

    produces "TRUE" and in conditional format will format all rows, unfortunately also those with 0 or nothing in column A.

    The expression,

    =AND(INDIRECT("D"&TEXT(ROW(),"0"))>0,INDIRECT("D"&TEXT(ROW(),"0"))<=5)

    does produce TRUE only if the value of the cell in column A is between 1 and 5 but not blank, but does not work in conditional formatting, at least in Excel 2007.

    The expression,

    =(INDIRECT("D"&TEXT(ROW(),"0"))>0)*(INDIRECT("D"&TEXT(ROW(),"0"))<=5)

    also produces the value 1 (TRUE) only if the value of the cell in column A is between 1 and 5 but not blank, and it does work in conditional formatting.

    There are other alternatives to solving the problem, such as using the combination of

    =INDIRECT("D"&TEXT(ROW(),"0"))=0 [check the stop if true box]
    =INDIRECT("D"&TEXT(ROW(),"0"))<=5

    BUT why doesn't the AND expression work? Some solutions in the forum do suggest the the use of AND and are reported to work. I downloaded a the example file AF010235700.XLSX and the AND expression doesn't work for me in that file either.

    Am I missing some setting in my computer or program? I have SP3 installed. http://www.excelforum.com/images/smilies/confused.gif

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: AND doesn't work in Conditional Formatting

    try using this: im not sure why you are using INDIRECT in this instance.

    =AND($A1>=1,$A1<=5,$A1<>"")
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: AND doesn't work in Conditional Formatting

    Post deleted!

    Reason: Same answer.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

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

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ 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