+ Reply to Thread
Results 1 to 9 of 9

Conditional Formatting using VLOOKUP

  1. #1
    Registered User
    Join Date
    05-28-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    86

    Conditional Formatting using VLOOKUP

    I want to monitor if a status has changed on Sheet1 between two columns - but only unexpected changes.

    I have a list on Sheet2 with column A containing original status and column B containing a list of changes the status could expect to make.

    I know a named range has to be used because sheet referencing doesn't work for conditional formatting.

    So I've been using this in the conditional formatting:

    =VLOOKUP(B2,change,2,0)=A2

    "change" refers to the named range of the two columns described on Sheet2.

    As you can see from the attached, 'Limp' has been correctly identified as unexpected, 'Leap' and 'Hike' are expected and should not be highlighted, and 'Fall' at the bottom should also be highlighted but is not.

    vlookupCF.xlsx
    Last edited by Knawl; 08-07-2014 at 12:17 PM.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Conditional Formatting using VLOOKUP

    It doesn't work because VLOOKUP stops looking when it finds the first instance of a match. So looking up "Walk" will only find "Walk" and not "Hike" nor "Stroll".

    Also, your conditional formatting formula starts in row 2 but your data starts in row 1 so everything is offset.
    Last edited by BadlySpelledBuoy; 08-07-2014 at 12:21 PM.

  3. #3
    Registered User
    Join Date
    05-28-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Conditional Formatting using VLOOKUP

    Ah okay. What do I need to do to make it account for every instance? Thanks.
    Last edited by Knawl; 08-07-2014 at 12:26 PM.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional Formatting using VLOOKUP

    You could make 2 named ranges on sheet 2
    1 for Column A - Call it Original
    1 for Column B - Call it Change

    Then use
    =COUNTIFS(Original,A1,change,B1)

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Conditional Formatting using VLOOKUP

    Is this how you'd expect it to look?

    EDIT: Jonmo1 beat me to it!
    Attached Files Attached Files

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional Formatting using VLOOKUP

    Although these solutions seem to have it backwards.
    They highlight the ones that DO match, but I think OP wants to highlight the ones that DON'T match.

    So instead of >0, use =0

    =COUNTIFS(Original,A1,change,B1)=0

  7. #7
    Registered User
    Join Date
    05-28-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Conditional Formatting using VLOOKUP

    That's great. Is there anyway to reverse the formatting? Only highlight when changes are detected instead of non-changes?

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Conditional Formatting using VLOOKUP

    See post #6

  9. #9
    Registered User
    Join Date
    05-28-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Conditional Formatting using VLOOKUP

    Excellent thanks. I used this to stop blank cells i the column from highlighting:

    =IF(A1>0,COUNTIFS(orig,A1,change,B1)=0,"")

+ 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. Using conditional formatting with vlookup
    By benno87 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-27-2008, 09:49 PM
  2. IF and VLOOKUP conditional formatting
    By penfold in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-07-2008, 07:05 AM
  3. VLOOKUP in Conditional Formatting
    By Brokovich in forum Excel General
    Replies: 5
    Last Post: 01-19-2007, 01:02 PM
  4. [SOLVED] Conditional formatting & Vlookup
    By Jean-Paul Hahn in forum Excel General
    Replies: 6
    Last Post: 01-24-2006, 05:40 PM
  5. [SOLVED] vlookup & conditional formatting
    By Emma in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-23-2005, 11:06 AM

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