+ Reply to Thread
Results 1 to 3 of 3

IF/AND/OR using Conditional Formatting

  1. #1
    Registered User
    Join Date
    11-17-2010
    Location
    Westbrook, Maine
    MS-Off Ver
    Excel 2007
    Posts
    15

    IF/AND/OR using Conditional Formatting

    I'm totally stumped.

    I have a spreadsheet where I created a conditional dropdown list.

    In cell D25 there is a dropdown with the options A, B, and C. In cell D27 is a second dropdown where the options provided are conditional based on what value is in D25. If D25 = A, then D27 offers 1. If D25 = B, then D27 offers 1 or 2. If D25 = C, then D27 offers 1, 2, or 3. This prohibits people from being offered the wrong number. That being said... I am trying to close a loophole.

    You can select C in D25, and then 3 in D27. You can then change D25 to A. A and 3 should not be together.

    Normally I'd use Data Validation, but I can't because it has a dropdown in it.

    My next idea was use conditional formatting to turn the whole spreadsheet red if someone tries to use the loophole. I wrote this formula, which works in the spreadsheet itself:
    =IF(OR(AND($D$25="A",$D$27>1),AND($D$25="B",$D$27>2)),"Format","Don't Format")

    However, I can't seem to figure out how to get it to work in Conditional Formatting. I went to New Rules, Use a formula to determine which cell to format, and put for the formula in Format values where this formula is true. Didn't work. Took out the If statement since that sounded inferred. Didn't work. Took out to the True/False values "Format" and "Don't Format." Didn't work.

    Stumped!

  2. #2
    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: IF/AND/OR using Conditional Formatting

    In Conditional Formatting rules try in this way.

    =OR(AND($D$25="A",$D$27>1),AND($D$25="B",$D$27>2))


    How can you use Conditional Formating.

    --In Excel 2007 and 2010, Conditional Formatting is in the Styles group on the Home tab. In Excel 2003, Conditional Formatting is on the Format menu. See here how you can work using CF.
    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.

  3. #3
    Registered User
    Join Date
    11-17-2010
    Location
    Westbrook, Maine
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: IF/AND/OR using Conditional Formatting

    Nope. It accepts the formula, but the cells don't actually format as requested. I am going into the format button and defining how I would like the cells to change. This is so odd.

+ 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 via VBA: Change formatting in range based on value of each cell
    By ralphjmedia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:37 AM
  2. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  3. Replies: 3
    Last Post: 05-15-2012, 04:13 PM
  4. Replies: 1
    Last Post: 03-05-2012, 06:20 PM
  5. Replies: 2
    Last Post: 11-02-2007, 12:03 PM

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