Excel Tutorial
Excel tutorials, quizzes & AI guides — all levels
RSS
  • Online Excel Exercises
  • Training
  • Excel Tests
  • Sitemap
  • Premium Quizzes
  • Shop
  • My account

Search in 2 Columns with VLOOKUP & XLOOKUP

Lookup functions
Reading time: 2 minutes
Views: 25,859

How do you search in 2 columns in Excel?

  • This task is not easy when you do it with VLOOKUP 😟
  • But if you use XLOOKUP, you can solve this problem straightforward 😃👍

Why Search Two Columns?

When working with dates and currencies, each date has different values for each currency. The currency code repeats daily.

  • Each date can have multiple currency values.
  • The same currency code appears more than once.

To get accurate results, we must build a unique identifier by combining the Date and Currency columns.

How to search in 2 columns
  • This document has been created with the STOCKHISTORY function

VLOOKUP Isn’t Ideal

VLOOKUP only searches in the first column 😡. This is how the function has been developed. Now, if you need to search in 2 columns, you must transform the table and concatenate the two columns to create a new column.

  1. Add a blank column in the first column to your table.
  2. Concatenate Date and Currency to create an ID with the & sign
  3. Repeat for the lookup table.
Create ID for both tables

After that, you create your VLOOKUP function by using the column as the first column of your reference table.

XLOOKUP Is Better

If you work with Excel 365, Excel Online, and Excel 2021, it’s better to use the XLOOKUP function. This function has been developed to remove the limitations of VLOOKUP. This includes performing a search in two columns 😉👍

  1. Combine the values in E2 and F2 using the & sign to create your identifier E2&F2
  2. Concatenate the columns in your table reference to match your ID. $A$2:$A$13&$B$2:$B$13
  3. Enter the column you want to return $C$2:$C$13, and your formula is ready!

This way, the XLOOKUP function returns a single result based on merging 2 cells and a search in 2 columns.

XLOOKUP is able to search in 2 columns

Related articles

  • Master XLOOKUP function in Excel
  • How to Use the VLOOKUP Function in Excel
  • VLOOKUP Left Lookup Using INDEX or XLOOKUP
  • How to return multiple rows with VLOOKUP

Frédéric LE GUEN

2 columns, VLOOKUP, XLOOKUP

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Viewed Posts

  • Displaying Negative Numbers in Parentheses in Excel (310,065)
  • Top 10 Excel Functions You Must Know (232,001)
  • How to make automatic calendar in Excel (212,775)
  • Dash for a zero in Excel automatically (190,813)
  • Converting a Date from YYYYMMDD to DD/MM/YYYY in Excel (171,034)
image excel exercises
Excel Exercises
image excel quizzes
Excel Quizzes

Search in 2 Columns with VLOOKUP & XLOOKUP

Reading time: 2 minutes
Views: 25,859

How do you search in 2 columns in Excel?

  • This task is not easy when you do it with VLOOKUP 😟
  • But if you use XLOOKUP, you can solve this problem straightforward 😃👍

Why Search Two Columns?

When working with dates and currencies, each date has different values for each currency. The currency code repeats daily.

  • Each date can have multiple currency values.
  • The same currency code appears more than once.

To get accurate results, we must build a unique identifier by combining the Date and Currency columns.

How to search in 2 columns
  • This document has been created with the STOCKHISTORY function

VLOOKUP Isn’t Ideal

VLOOKUP only searches in the first column 😡. This is how the function has been developed. Now, if you need to search in 2 columns, you must transform the table and concatenate the two columns to create a new column.

  1. Add a blank column in the first column to your table.
  2. Concatenate Date and Currency to create an ID with the & sign
  3. Repeat for the lookup table.
Create ID for both tables

After that, you create your VLOOKUP function by using the column as the first column of your reference table.

XLOOKUP Is Better

If you work with Excel 365, Excel Online, and Excel 2021, it’s better to use the XLOOKUP function. This function has been developed to remove the limitations of VLOOKUP. This includes performing a search in two columns 😉👍

  1. Combine the values in E2 and F2 using the & sign to create your identifier E2&F2
  2. Concatenate the columns in your table reference to match your ID. $A$2:$A$13&$B$2:$B$13
  3. Enter the column you want to return $C$2:$C$13, and your formula is ready!

This way, the XLOOKUP function returns a single result based on merging 2 cells and a search in 2 columns.

XLOOKUP is able to search in 2 columns

Related articles

  • Master XLOOKUP function in Excel
  • How to Use the VLOOKUP Function in Excel
  • VLOOKUP Left Lookup Using INDEX or XLOOKUP
  • How to return multiple rows with VLOOKUP
Tags: 2 columnsVLOOKUPXLOOKUP

Frédéric LE GUEN

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net