+ Reply to Thread
Results 1 to 7 of 7

Conditional Formatting

  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    ---
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question Conditional Formatting

    Hi All,
    I need to add conditional formatting on a range of cells.
    If value in a cell different from “y” or “n” (case insensitive) the cell should be highlighted red.

    I can use conditional format for “Format only cells that contain” [specific text][not containing][Y].
    But it doesn’t accept OR(“Y”,”N”)

    Any ideas?

    Thanks.

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Conditional Formatting

    Welcome to the forum.

    It sounds like you want the cell to be highlighted if it's value does not equal "Y" and does not equal "N".

    =AND(A1<>{"Y","N"})
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Registered User
    Join Date
    10-04-2011
    Location
    ---
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Conditional Formatting

    Is it for "Use a formula to determine which cells to format"?

  4. #4
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Conditional Formatting

    Sure, give it a try.

  5. #5
    Registered User
    Join Date
    10-04-2011
    Location
    ---
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Conditional Formatting

    nop. it doesn't work for me.
    do I have to rewrite the formula for each cell?
    AND(A1<>{"Y","N"})
    AND(A2<>{"Y","N"})
    AND(A3<>{"Y","N"})
    ...

  6. #6
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Conditional Formatting

    Conditional formatting won't let you use array constants. We could use a name to work around this, but it's quite simple in this case just to make a small adjustment to the formula instead.

    Let's suppose you want to apply the logic to cells C3:C20.

    Select cells C3:C20.
    Apply this conditional formatting formula:
    =AND($C3<>"Y",$C3<>"N")


    Because the row 3 isn't fixed with a $ sign, Excel will automatically adjust it for you down the column. In fact, because it's all in one column, we didn't really have to fix the column letter (it wouldn't be adjusted), but I included in the example to try to make it clearer.

  7. #7
    Registered User
    Join Date
    10-04-2011
    Location
    ---
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Conditional Formatting

    thanks. =AND($C3<>"Y",$C3<>"N") works for cells C3:C20

    I tried to modify for E3:G6
    =AND($E$3:$G$6<>"Y",$E$3:$G$6<>"N")
    but no result. with out $ it gives me strange result - highlight whole row E:G and skips empty.
    Attached Files Attached Files

+ 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