+ Reply to Thread
Results 1 to 11 of 11

Conditional Formatting if Matching Set of Values

  1. #1
    Registered User
    Join Date
    06-28-2007
    MS-Off Ver
    MS365 (Mac) Version 16.68 (22121100)
    Posts
    41

    Conditional Formatting if Matching Set of Values

    I am simply trying to add a conditional format that fills in a cell with a color if it is equal to any data that is in a list.

    See attached.

    I want Columns D & E to reference columns A & B to check if the name is there and to fill in the cells a color if it's true. I want to be able to add as many names as I want to A & B so I need a full column reference.

    What is the formula I enter into the conditional formatter?

    Thank you
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-28-2007
    MS-Off Ver
    MS365 (Mac) Version 16.68 (22121100)
    Posts
    41

    Re: Conditional Formatting if Matching Set of Values

    Bump to top

  3. #3
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: Conditional Formatting if Matching Set of Values

    I use excel 2003 to do a test. I think its ok in 2007.

    I use a name called last to denote last row.
    You can press Control + F3 to see it.

    Conditional formula is as follows:
    Please Login or Register  to view this content.
    Attached file is a sample.

    Hope this helps,
    windknife
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-28-2007
    MS-Off Ver
    MS365 (Mac) Version 16.68 (22121100)
    Posts
    41

    Re: Conditional Formatting if Matching Set of Values

    Thank you for your input again, Windknife. The formula works, but it really bogs down my computer for some reason. I am on a Mac though, using Excel 2008 for Mac.

    Any other less cumbersome solutions possibly?

    Thank you again.

  5. #5
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Conditional Formatting if Matching Set of Values

    Try this

    =SUMPRODUCT(--($A$1:$A$1000=$D1),--($B$1:$B$1000=$E1))

    adjust the 1000 to a resonable number!
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional Formatting if Matching Set of Values

    That formula of Squiggler's is not a conditional format, if that's not obvious. Slip that into Column C and all the 1s flag the duplicates. You could then use a simple =C1>0 for the conditional formatting in D and E to light them up.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Registered User
    Join Date
    09-01-2008
    Location
    Houston, TX
    Posts
    70

    Re: Conditional Formatting if Matching Set of Values

    It worked for me when I tested it as a conditional format but I had to add and if entry in D column is blank then 0...without the "if" the blank cells were also filled
    Gary

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Conditional Formatting if Matching Set of Values

    you could do it with formula is option in conditional format by using
    =SUMPRODUCT(--($A$1:$A$1000=$D1),--($B$1:$B$1000=$E1))>0
    OOPS
    try
    =AND(ISTEXT($D1),ISTEXT($E1),(SUMPRODUCT(--($A$1:$A$1000=$D1),--($B$1:$B$1000=$E1))>0))
    Last edited by martindwilson; 06-07-2009 at 05:51 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Conditional Formatting if Matching Set of Values

    The formula I gave is for conditional formatting!!!

    it will evaluate to true or false!

  10. #10
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Conditional Formatting if Matching Set of Values

    The formula I gave is conditional, I didnt allow for the blanks but

    Please Login or Register  to view this content.
    Does!
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Conditional Formatting if Matching Set of Values

    Another alternative

    Please Login or Register  to view this content.
    It should work faster as it limits the searches to only the range in column a with a text value, so the blank check can be avoided, the only case it wont work for is if there is only a surname!

+ 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