EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Certification Courses
  • 120+ Courses All in One Bundle
  • Login
Home Excel Excel Resources Lookup & Reference Functions in Excel Compare Two Columns in Excel using VLOOKUP
Secondary Sidebar
Excel Functions
  • Lookup and Reference Functions in Excel
    • VLOOKUP Function in EXCEL
    • VLOOKUP True
    • VLOOKUP Error
    • How to Match Data in Excel
    • Excel Match Function
    • Excel Lookup Function
    • ROWS Function in Excel
    • Excel INDEX Function
    • VLOOKUP Table Array
    • Excel OFFSET Formula
    • VLOOKUP For Text
    • IF VLOOKUP Formula in Excel
    • Mixed Reference in Excel
    • CHOOSE Formula in Excel
    • Excel COLUMN to Number
    • Excel Alternatives to VLOOKUP
    • HLOOKUP Examples
    • Excel VLOOKUP From Another Sheet
    • VLOOKUP with Sum
    • Fixing VLOOKUP Errors
    • Compare Two Columns in Excel using VLOOKUP
    • Excel ROW Function
    • HYPERLINK in Excel
    • Address Excel Function
    • Excel COLUMNS Function
    • Excel REPLACE Function
    • OFFSET Excel Function
    • Excel GETPIVOTDATA Function
    • MATCH Function in Excel
    • VLOOKUP Function in Excel
    • HLOOKUP Function in Excel
    • LOOKUP in Excel
    • CHOOSE Function in Excel
    • TRANSPOSE in Excel
    • COLUMN Function in Excel
    • INDIRECT Function in Excel
  • Excel Functions (12+)
  • Excel Tools (114+)
  • Financial Functions in Excel (17+)
  • Logical Functions in Excel (14+)
  • Maths Function in Excel (47+)
  • TEXT and String Functions in Excel (26+)
  • Date and Time Function in Excel (24+)
  • Statistical Functions in Excel (59+)
  • Information Functions in Excel (4+)
  • Excel Charts (56+)
  • Excel Tips (220+)
  • Workplace Productivity (4+)
  • Microsoft Office Tools (15+)
  • Excel Formula and Functions (22+)
  • MS Excel Shortcuts (4+)
Excel Functions Courses
  • Online EXCEL COURSE
  • Online EXCEL ADVANCED Training

Compare Two Columns in Excel using VLOOKUP

Compare Two Columns in Excel main image

Excel Compare Two Columns (Table of Contents)

  • How to Compare Two Columns in Excel Using VLOOKUP?
  • Examples of Compare Two Columns in Excel using VLOOKUP

Compare Two Columns in Excel using VLOOKUP &  Find Data

While working with data in Excel, sooner or later, you will be in need to make a comparison between two columns to check whether data from one column is present in another column or not. When it comes to making comparisons between two columns, lookup functions are the best in business. We can use the VLOOKUP function to compare whether two columns have matching data within them or not. This function saves you a huge amount of time while working on a large amount of data where you need to compare two columns. Which increases productivity and reduces the time taken for a task to complete.

Start Your Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

How to Compare Two Columns in Excel Using VLOOKUP?

When we have two columns and need to check whether reference values from one column are available in another column, VLOOKUP can be the best alternative to do so. As this function is potent to capture/looks up the data among several other columns based on a lookup value.

Syntax

Vlookup in Excel 1-1

Arguments

  • lookup_value – is the value that is used as reference while looking up
  • table_array – is the table/range of the data within which we want to check specific values based on the lookup value.
  • col_index_num – is the column number in the range of data from which we are going to get the values after lookup.
  • Range_lookup – is an optional argument that specifies whether we need an exact matching value (FALSE) or approximate matching values (TRUE).

We will see some examples using which we can specify how to compare two columns in Excel using the VLOOKUP function.

Examples of Compare Two Columns in Excel using VLOOKUP

we will discuss Examples of Compare Two Columns in Excel.

You can download this Compare Two Columns using VLOOKUP Excel Template here – Compare Two Columns using VLOOKUP Excel Template

Example #1

Consider mixed data as shown below in columns A and B of the excel sheet.

Vlookup in Excel 1-2

In column C, we need to check whether the values in column “Text B” are matching with those in “Text A”. Follow the steps below to get the comparison within these two columns using the VLOOKUP function.

Step 1: Initiate the VLOOKUP function in cell C2 by typing “=VLOOKUP(“.

Vlookup in Excel 1-3

Step 2: The first argument we need to specify is the lookup value. Since we are trying to lookup whether the values from column Text A are present in a column named Text B, we need to specify the lookup value from column A. Since we are working with cell C2, it is better to use A2 as the lookup value. separate it with a comma (“,”) to specify the next argument.

Vlookup in Excel 1-4

Step 3: The second argument for the VLOOKUP function is table_array. Which will be the range of data within which we wanted to check the values based on lookup_value. In our case, it is a column named Text B. Thus, select range from B2:B9 as a table_array and fix it using dollar signs so that the range will be the same for the formula when we copy it and paste it across different cells. You can use the keyboard shortcut F4 to fix the table range.

Vlookup in Excel 1-5

Step 4: Third and most important argument is to specify the column index from the table_array, which can be used to lookup the values. Since we only have one column selected as table_array, we can use the col_index_num value as 1.

Vlookup in Excel 1-6

Step 5: The last argument is optional, which is range_lookup. Since it specifies whether we want an exact match or an approximate match, we can use TRUE (approximate match) or FALSE (exact match) for the same. We will be interested here in exact matches; thus, we will use FALSE as range_lookup argument.

Vlookup in Excel 1-7

Note that, we can also use the Boolean values for TRUE and FALSE as 1 and 0, respectively, under the VLOOKUP function.

Step 6: Use closing parentheses to complete the formula and press Enter to get the output. Note that, if the function finds an exact match for the text in column A under column B, it will reflect the text, otherwise it will reflect the #N/A error. Also, drag the formula across rows to get the formula applied for all cells.

Vlookup in Excel 1-8

This is how we can compare two columns in Excel using the VLOOKUP function. However, the #N/A’s are not looking that great in the data. It may look weird to someone who doesn’t know anything about the formula/function. Let’s see another example where we try to get a more concrete solution for this issue.

Example #2

In this example, we are going to use conditional IF, and ISNA with VLOOKUP to see whether the values from column A are present in column B or not.

Step 1: Start the formula with “=IF(“ and within it, use ISNA as a nested function as shown below:

Compare Two Columns in Excel using VLOOKUP 2-1

Step 2: Use the VLOOKUP function to check whether the values from column A are present in column B. same as we used in the first example. Close the parentheses for both VLOOKUP and ISNA functions. See the screenshot below for a better understanding.

Compare Two Columns in Excel using VLOOKUP 2-2

Step 3: Now, we need to specify the values for the value_if_true argument for conditional IF. Specify it as “Not Present”. Don’t forget to use double quotes.

Compare Two Columns in Excel using VLOOKUP 2-3

Step 4: For value_if_false, we need to specify the value. Use “Present” as a value for the argument. See the screenshot as shown below:

Compare Two Columns in Excel using VLOOKUP 2-4

Step 5: Close the parentheses to complete the formula and press Enter button to get the output in cell C2. Also, drag the formula across the rows to get the desired output in terms of “Present” or “Not Present”. See the screenshot below for your reference.

Compare Two Columns in Excel using VLOOKUP 2-5

How does this work? Well, it is simple. Since ISNA checks whether the VLOOKUP returns #N/A or not, if there are any #N/A, the function returns TRUE, and thus IF function has “Not Present” as an argument for this output. Similarly, if ISNA doesn’t find #N/A, then the value it returns is FALSE, and we have “Present” as an argument under the conditional IF statement.

Thus, wherever we are getting Not Present, those are the values from column A which don’t have matching in column B.

We will wrap this article to end it here. However, we have some points to remember for you all.

Things to Remember

  • VLOOKUP doesn’t need the values to be ordered within the two columns while comparing the same.
  • If VLOOKUP doesn’t get the match for lookup_value under table_array, it returns by default as #N/A error.
  • We can combine VLOOKUP with IF and ISNA to generate a more versatile result where no #N/A gets reflected within the data for those values which doesn’t match.

Recommended Articles

This has been a guide to Compare Two Columns in Excel using VLOOKUP. Here we discuss How to Compare Two Columns in Excel using VLOOKUP, along with practical examples. You can also go through our other suggested articles –

  1. Date Formula in Excel
  2. HLOOKUP Formula in Excel
  3. Excel RATE Formula
  4. Interactive Chart in Excel
Popular Course in this category
Excel Training (23 Courses, 9+ Projects)
  23 Online Courses |  9 Hands-on Projects |  110+ Hours |  Verifiable Certificate of Completion
4.9
Price

View Course

Related Courses

Excel Advanced Training (16 Courses, 23+ Projects)4.9
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Excel Charts
  • Excel Tips
  • All Tutorials
Certification Courses
  • All Courses
  • Excel VBA Course - All in One Bundle
  • VBA Course
  • Excel Data Analysis Course
  • Excel for Marketing Course
  • Excel for Finance Course
  • Excel for HR Training

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

Download Compare Two Columns using VLOOKUP Excel Template

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

Download Compare Two Columns using VLOOKUP Excel Template

EDUCBA

डाउनलोड Compare Two Columns using VLOOKUP Excel Template

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more