+ Reply to Thread
Results 1 to 7 of 7

Conditional Formatting based on 3 different cell values (criteria)

  1. #1
    Registered User
    Join Date
    12-15-2005
    Posts
    30

    Conditional Formatting based on 3 different cell values (criteria)

    Hi there,

    I would like to have a conditional formatting formula which can highlight a value and the top and left labels that correspond to it.

    Here is my example :

    Drop-down lists using Validation
    Which Item ? __Bread___ (in cell M10)
    Which Month ? __Feb_____ (in cell M11)

    Result (using a combination of Match and Index)
    Amount = __75_____ (in cell M13)

    Jan Feb Mar Apr May Jun
    Eggs 75 31 83 59 38 66
    Bread 15 66 95 25 63 97
    Milk 36 58 18 31 58 46
    Cheese 25 75 62 38 95 28
    Meat 14 45 44 49 45 54
    Veggies 87 96 81 65 25 53
    Kleenex 94 32 37 88 38 95
    Shampoo 19 52 64 61 76 85

    Conditional Formattings applied to entire table above
    1) =NOT(ISERR(SEARCH($M$10,C10)))…..(highlights column title “Feb” correctly)
    2) =NOT(ISERR(SEARCH($M$11,C10))) …..(highlights row title “Bread” correctly)
    3) =NOT(ISERR(SEARCH($M$13,C10))) …..(highlights all 3 amounts of “75” incorrectly – need it to only highlight the 75 that corresponds to the intersection of item “Bread” and month “Feb”)

    What formula (or combination of formulas can I use to achieve this ?

    In short, I require conditional formatting to highlight an amount and it’s corresponding top label and side label based on selections made using a drop-down list.

    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Where do you have your source data located? From your data above, I can't see how the intersection of Bread and Feb produces 75. I get 66. That could be how I have the data positioned.

    Better still, can you generate a small sample file showing your structure and put it on the board.

    I think the formula would be along the lines of
    =AND($A2=$M$10,B$1=$M$11)
    Again it would have to be adjusted for your data structure.

    rylo
    Last edited by rylo; 05-03-2007 at 02:24 AM.

  3. #3
    Registered User
    Join Date
    12-15-2005
    Posts
    30

    Attachment Incl. - Conditional Formatting based on 3 different cell values (criteria)

    Thanks for your reply Rylo !

    You were correct about the 66 i/o 75 (I had originally written out my post with just 3 rows and 3 col's of data - whereby I had manually adjusted the feb bread value to be 75 - but then just before posting, I copied and pasted the entire data table from my S/S to show all rows and cols...since the formulas were refering to more than just 3 rows and cols).

    I have now attached a zip file containing the sheet.

    Appreciate your help.

    Later
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by xlguy
    Thanks for your reply Rylo !

    You were correct about the 66 i/o 75 (I had originally written out my post with just 3 rows and 3 col's of data - whereby I had manually adjusted the feb bread value to be 75 - but then just before posting, I copied and pasted the entire data table from my S/S to show all rows and cols...since the formulas were refering to more than just 3 rows and cols).

    I have now attached a zip file containing the sheet.

    Appreciate your help.

    Later
    Hi

    Sometimes you try to do things in a way which is complex despite having simple ways (it depends upon how you think).

    see the attached file and look how the Conditional Formatting is applied to get the required results.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-15-2005
    Posts
    30

    Smile Conditional Formatting based on 3 different cell values (criteria)

    Thanks Starguy ! You are indeed a genius...and your solution is so elegant....I'm truly impressed

    I honestly didn't think it would be that simple....however, I still don't understand how the third conditional format works i.e. the "3) Range D11:I18 has =AND($C11=$M$10,D$10=$M$11)". Would you be able to explain how it does, what it's doing so well ?

    Thanks again,

    Later

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    The AND statement will evaluate to TRUE when the value in column C for that row matches the product selected in M10 and the value in row 10 for the cell column equals the value in M11. If the result is TRUE then the conditional formatting will apply.


    rylo

  7. #7
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by xlguy
    Thanks Starguy ! You are indeed a genius...and your solution is so elegant....I'm truly impressed

    I honestly didn't think it would be that simple....however, I still don't understand how the third conditional format works i.e. the "3) Range D11:I18 has =AND($C11=$M$10,D$10=$M$11)". Would you be able to explain how it does, what it's doing so well ?

    Thanks again,

    Later
    Hi xlguy
    Thank you for the feedback.

    I'll suggest you to look in Excel help for AND function.
    Improtant in this formula is the use of $ (i-e relative and abolute refereces). See the link below to understand the use of $.

    http://www.cpearson.com/excel/relative.htm

+ 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