You are here:

Excel/Conditional formatting using Vlookup


I've a excel file that has 2 worksheets. What I want to do is change format according to matching values in sheet2

  Sheet1          Sheet2
  ------          --------
Ref.No.,LVL,Qty         ALIAS,   DESCRIPTION
-------,---,---     --------------,------------
99.1   ,0  ,          99.1      ,Misc. Work
A.3    ,2  ,36         A.7.1      ,Flexible
A.7.1  ,3  ,23080   .
.         .
.         .

IF value of "REF.NO." Column in sheet1 found in Sheet2 column "Alias". cell format of Column Qty. in sheet1 should change.
(see attached image)

For this I tried      
  Home->Conditional Formatting->New Rule   
  Use a formula to determine which cells to format   
  **Format values where this formula is true**   
     =MATCH(A3, Sheet2!A:A, 0)
But an error message occurred "You cannot use references to other worksheets or workbooks for Conditional Formatting criteria."

Hi Ajay,

You can't use match to serve that purpose. (Unfortunately, Match is the most misunderstood function in excel).

You can use a combination of vlookup, if, ISERROR and conditional formatting.

If I can suggest a simple approach, you can create a column where you populate true or false values if the vlookup finds the required value. Now, you can apply conditional formatting based on the True or false value populated in the column. This will keep your solution simple to maintain.

Apologies for the late response.
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


All Answers

Answers by Expert:

Ask Experts




I can answer questions related to the following topics: 1. MS Excel - Creating and Linking Formulae, Running Pivot Tables, Vlookup etc. 2. Macros / VBA - Creating Macros to do specific jobs. Importing / Exporting / Validating Data in excel through Macros.


I've been working on excel for over 10 years and on VBA macros for over 3 years now.

Bachelor of Commerce, Chartered Accountant from The Institute of Chartered Accountants of India

©2016 All rights reserved.