You are here:

Excel/Conditional Formatting with VLookup?

Advertisement


Question
Hi Bob,

I am trying to highlight a cell by using Conditional Format (format the fill colour) based on the text contents using VLOOKUP, but it's not working.

On sheet Games I have a leaderboard, which has up to 48 names.  Of these 48, 50% are "Codgers" and 50% are "Guns" (basically a Young vs Old competition).

On Sheet Teams I have five columns K thro O which have the same names in Column K, and in Column O is either a G for Guns or C for Codgers.

I am trying to conditionally format the Games sheet cells by determining through a formula VLOOKUP incorporating the Teams sheet response.  I tried this on the cell on the Games sheet:

="IF(VLOOKUP($A$5,TEAMS!$K:$O,5,0)=G,1,0)"

and nothing happens, but no error message.

Any clues please, and/or is that enough information?

thanks in anticipation
Pete

Answer
First, there should be no quotes in the formula you gave. Next, the character "G" SHOULD have quotes:
=IF(VLOOKUP($A$5,TEAMS!$K:$O,5,0)="G",1,0)
Then apply the conditional formatting based on 1 or 0.
However, you could also have just done the VLOOKUP:
=VLOOKUP($A$5,TEAMS!$K:$O,5,0) and do a conditional formatting on cells containing "G"  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bob Umlas

Expertise

I`m a Microsoft Excel MVP (Most Valuable Professional) and have been since the inception of the program in 1995. I can answer every kind of Excel question except: API, Importing/exporting to other programs (powerpoint, word,...) Also check out my in-person training link at http://www.thumbtack.com/ny/new-york/excel-training/

Experience

Worked with MS Excel since version 0.99 (on the Mac!). Was contributing editor to Excellence Magazine, having written >300 articles. John Walkenbach said of me "I finally met someone who knows as much about Excel as I do."

Publications
Excellence, The Expert, Microsoft

Education/Credentials
BA in math, Hofstra University, 1965

Awards and Honors
MVP
Led sessions for the Convergence 2004-2006 seminar on Excel tips & tricks

©2016 About.com. All rights reserved.