+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting using lookup table and combination of column and header value

  1. #1
    Registered User
    Join Date
    10-26-2017
    Location
    NYC
    MS-Off Ver
    2007
    Posts
    2

    Conditional formatting using lookup table and combination of column and header value

    Hi!

    So this is a simplified example of what I'm working with.

    The first table is a representation of '# of products sold' in each category by state. So NJ sold 0 books.

    The next table is my color code look up table.

    I need a formula that will highlight cells B2:D4 (in my first sheet) with the corresponding color code when the '# of products sold' = 0

    Any idea if this is possible in Excel?

    Thanks!!

    Sheet1:

    | A | B | C | D
    1 | Category | NJ | PA | NY
    2 | Books | 0 | 3 | 2
    3 | Clothes | 5 | 0 | 4
    4 | Electronics | 1 | 2 | 0


    Sheet2:

    | A | B | C
    1| Category | State| Color Code
    2| Books | NJ | Red
    3| Clothes | NJ | Blue
    4| Electronics | NJ | Green
    5| Books | PA | Green
    6| Clothes | PA | Red
    7| Electronics | PA | Red
    8| Books | NY | Blue
    9| Clothes | NY | Blue
    10| Electronics| NY | Green

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional formatting using lookup table and combination of column and header value

    Hello and welcome to the forum.

    In order to do with without VBA, you will have to create one rule for each color on Sheet2. In this case, you have 3 colors so we will create 3 rules.

    Rule 1:
    Highlight B2:D4 of Sheet1 > Conditional Formatting > New Rule > Use a formula
    =AND(B2=0,INDEX(Sheet2!$C$2:$C$10,MATCH($A2&B$1,Sheet2!$A$2:$A$10&Sheet2!$B$2:$B$10,0))="Red")
    Format: Fill Red > OK > OK

    Rule 2:
    Highlight B2:D4 of Sheet1 > Conditional Formatting > New Rule > Use a formula
    =AND(B2=0,INDEX(Sheet2!$C$2:$C$10,MATCH($A2&B$1,Sheet2!$A$2:$A$10&Sheet2!$B$2:$B$10,0))="Blue")
    Format: Fill Blue > OK > OK

    Rule 3:
    Highlight B2:D4 of Sheet1 > Conditional Formatting > New Rule > Use a formula
    =AND(B2=0,INDEX(Sheet2!$C$2:$C$10,MATCH($A2&B$1,Sheet2!$A$2:$A$10&Sheet2!$B$2:$B$10,0))="Green")
    Format: Fill Green > OK > OK

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,657

    Re: Conditional formatting using lookup table and combination of column and header value

    Creat 3 independent formulas for 3 colours.

    See attachment.
    Attached Files Attached Files
    Quang PT

  4. #4
    Registered User
    Join Date
    10-26-2017
    Location
    NYC
    MS-Off Ver
    2007
    Posts
    2

    Re: Conditional formatting using lookup table and combination of column and header value

    Genius!! Thank you guys!!!!

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional formatting using lookup table and combination of column and header value

    You're welcome. Glad we could help.

+ 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. Replies: 13
    Last Post: 09-29-2016, 08:56 AM
  2. How to lookup value in table and return column header
    By Zimmerman in forum Excel General
    Replies: 3
    Last Post: 03-14-2016, 08:53 AM
  3. [SOLVED] Find specific value in table and return header row and header column value
    By nelwan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2013, 01:35 AM
  4. [SOLVED] Create Dynamic Column Lookup Reference based on Table Header
    By jeversf in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-22-2013, 12:49 PM
  5. Replies: 4
    Last Post: 01-04-2013, 12:22 PM
  6. conditional formatting and lookup table
    By isobelo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2012, 05:41 PM
  7. Row,Column header lookup from table data
    By boco in forum Excel General
    Replies: 4
    Last Post: 12-22-2009, 09:15 PM

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