XLOOKUP Function in Excel – The Modern Replacement for VLOOKUP

XLOOKUP Function in Excel – The Modern Replacement for VLOOKUP
XLOOKUP Function in Excel – The Modern Replacement for VLOOKUP
Ads loading…

📌 Introduction

If you have ever used VLOOKUP in Excel, you know the frustration. It can only search from left to right, it breaks when you insert a column, and it always picks the first match — even when you need something else. For years, Indian professionals using Excel for MIS reports, salary sheets, and GST data have struggled with these VLOOKUP limitations.

Microsoft heard the complaints. In 2019, they introduced a brand new function called XLOOKUP — and it solves almost every problem VLOOKUP has. It is more powerful, easier to write, and far more flexible. Whether you are a beginner or a working professional, XLOOKUP is the lookup formula you should be learning in 2026.

In this post, you will learn exactly what XLOOKUP is, how to use it with real Indian examples, the step-by-step process, common mistakes to avoid, and pro tips to use it like an expert.

Ads loading…

Advertisement-X

Ads loading…

Advertisement-X

📌 What is the XLOOKUP Function?

XLOOKUP is a lookup function in Excel that searches for a value in a range or array and returns the corresponding value from another range or array. Think of it like a smart search engine inside Excel.

Real Indian Example: Rahul works in the HR department of a company in Pune. He has a list of 500 employee IDs and their salaries in one sheet. Every month, his manager gives him a list of 50 employee IDs and asks him to fetch their salaries. Instead of searching manually, Rahul uses XLOOKUP — he types the employee ID, and Excel instantly returns the salary from the data sheet. What used to take 30 minutes now takes 30 seconds.

ℹ️

Availability Note
XLOOKUP is available in Excel 365, Excel 2021, and Excel for the web. If you are using Excel 2019 or older, you will need to use INDEX+MATCH instead. Check your version: File → Account → About Excel.

📌 Syntax of XLOOKUP

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

Parameter Explanation

ParameterRequired?What it means
lookup_value✔ YesThe value you want to search for (e.g. Employee ID, Product Code)
lookup_array✔ YesThe column or row to search in (where your IDs or codes are listed)
return_array✔ YesThe column to return the result from (e.g. Salary, City, Department)
[if_not_found]OptionalWhat to show if no match is found — e.g. “Not Found” instead of #N/A error
[match_mode]Optional0 = exact match (default), -1 = next smaller, 1 = next larger, 2 = wildcard
[search_mode]Optional1 = first to last (default), -1 = last to first, 2 = binary ascending, -2 = binary descending

📌 XLOOKUP Example with Indian Data

Priya is an accountant at a Delhi-based trading company. She has an employee database in Sheet1 and needs to fetch the Department and Salary for specific employees in her MIS report.

Employee Database (Sheet1 — A1:D8)

Emp IDEmployee NameDepartmentSalary (₹)
EMP001Rahul SharmaSales₹45,000
EMP002Priya MehtaAccounts₹52,000
EMP003Amit JoshiIT₹68,000
EMP004Suresh KumarHR₹38,000
EMP005Neha VermaMarketing₹41,000
EMP006Vikram SinghOperations₹55,000

XLOOKUP Formulas and Results

TaskFormulaResult
Find the salary of EMP003=XLOOKUP("EMP003",A2:A7,D2:D7)₹68,000
Find the department of EMP005=XLOOKUP("EMP005",A2:A7,C2:C7)Marketing
Search with a custom error message=XLOOKUP("EMP009",A2:A7,D2:D7,"Not Found")Not Found
Find name using cell reference=XLOOKUP(G2,A2:A7,B2:B7,"Not Found")Rahul Sharma

📌 Step-by-Step: How to Use XLOOKUP

Follow these steps to write your first XLOOKUP formula in Excel:

1

Set up your data table

Make sure your data has a unique ID column (like Employee ID or Product Code) and the value you want to return (like Salary or Price) in any column — left or right of the ID column.

2

Click on the cell where you want the result

For example, if you want to show Amit’s salary in cell H2, click on H2.

3

Type the formula

Type =XLOOKUP( — Excel will show you a tooltip with the parameters to fill in.

4

Fill the three required arguments

First: the value to look for (or the cell containing it). Second: the column to search in. Third: the column to return from. Separate each with a comma.

5

Add the “if_not_found” argument

Always add a fourth argument like "Not Found" to avoid ugly #N/A errors when an ID is not in your data.

6

Press Enter and drag down

Press Enter to see the result. Then click on the result cell and drag the formula down to apply it to all rows in your list.

💡

Pro Tip — Lock your arrays
When dragging the formula down, press F4 on the lookup_array and return_array to add dollar signs — e.g. $A$2:$A$100. This prevents the range from shifting when you copy the formula down.

📌 When Should You Use XLOOKUP?

  • Fetching employee salary, department, or designation from HR master data in Tally or SAP exports
  • Looking up GST rates or HSN codes for products in a tax invoice sheet
  • Pulling customer details (city, credit limit, outstanding balance) from a customer master list
  • Building MIS reports where you need to merge data from two different Excel sheets
  • Fetching product price or stock quantity from an inventory list for quotation preparation
  • Replacing your existing VLOOKUP formulas that break when new columns are inserted
  • Searching from right to left — which VLOOKUP cannot do at all

📌 Common Mistakes Beginners Make

MistakeWhat Goes WrongHow to Fix It
Different array sizesReturns #VALUE! errorMake sure lookup_array and return_array have the same number of rows (e.g., both A2:A100 and D2:D100)
Not locking array referencesThe formula gives wrong results when draggedPress F4 to add $ signs: $A$2:$A$100
Extra spaces in dataReturns “Not Found” even when the value existsUse TRIM: wrap the lookup value in TRIM() Or clean your data first
Using an older Excel versionReturns #NAME? errorXLOOKUP needs Excel 365 or 2021. Use INDEX+MATCH for older versions
No if_not_found argumentShows ugly #N/A error in reportAlways add 4th argument: "Not Found" or ""
⚠️

Important — Case Sensitivity
XLOOKUP is not case-sensitive by default. “emp001” and “EMP001” will match each other. If you need case-sensitive lookup (e.g., passwords or product codes with mixed case), use EXACT() inside the formula with the match_mode set to 2 (wildcard).

📌 Pro Tips for XLOOKUP

💡 Tip 1 — Return multiple columns

Use a multi-column return_array  B2:D100 to return Name, Dept, and Salary all at once with a single formula — impossible with VLOOKUP!

💡 Tip 2 — Search last to first

Set search_mode to -1 to find the last occurrence. Perfect for finding the most recent transaction date for a customer in your Tally export.

💡 Tip 3 — Nest two XLOOKUPs

Use XLOOKUP inside XLOOKUP to do a two-way lookup — find a value at the intersection of a row and column. Ideal for pricing matrices with different products and cities.

💡 Tip 4 — Wildcard search

Set match_mode to 2 and use * wildcard: "Rahul*" will match “Rahul Sharma”, “Rahul Mehta” — great for partial name lookups.

📌 XLOOKUP vs VLOOKUP — Quick Comparison

FeatureVLOOKUPXLOOKUP
Search directionLeft to right onlyAny direction ✔
Column index needed?Yes (error-prone)No — just select the column ✔
Breaks when column is inserted?Yes ✘No ✔
Custom error messageNeeds IFERROR wrapperBuilt-in 4th argument ✔
Return multiple columnsNo ✘Yes ✔
Find the last matchNo ✘Yes (search_mode -1) ✔

📥

Free Practice Workbook — Download Now!We have created 5 hands-on practice exercises for XLOOKUP — from basic lookups to advanced multi-column returns and nested XLOOKUP. Download the free workbook from XplorExcel.com and practice with real Indian data sets, including employee records, product inventories, and sales reports.

🎯 Conclusion

XLOOKUP is, without doubt, the best lookup function in Excel today. It is simpler to write than VLOOKUP, more powerful, and much more reliable. Whether you are building an employee salary report, a GST invoice, an MIS dashboard, or a product price list, XLOOKUP will make your work faster and error-free.

Key things to remember:

3 required arguments
Always add “if_not_found.”
Lock arrays with F4
Works left, right, any direction
Returns multiple columns
Needs Excel 365 or 2021

Download the free practice workbook, try all 5 exercises, and you will master XLOOKUP in one sitting! If you found this helpful, please share it with your colleagues. Leave any questions in the comments below. Happy learning! 😊

Ads loading…

Advertisement-X

Amanpreet Kaur Bharaj
Welcome to my profile! My name is Amanpreet Kaur, and I am a Freelance Microsoft Excel Specialist with an extensive background in data management and analysis. I offer top-tier Excel services, helping businesses optimize their processes, make informed decisions, and improve overall efficiency.Over the years, I have honed my skills in Excel to provide solutions tailored to each client's unique needs. I specialize in creating and maintaining complex Excel spreadsheets, utilizing advanced functions and formulas for optimal data processing, and designing macros to automate repetitive tasks.My expertise extends to crafting custom Excel VBA scripts, which allows me to cater to specific project requirements. Additionally, I am adept at building and managing pivot tables for robust data analysis and visualization. I also offer data cleaning services to ensure data integrity and reliability.With a keen eye for detail and a strong commitment to accuracy, I provide Excel-related technical support and training, always ensuring the highest quality in the work I deliver. My strong analytical and problem-solving skills, combined with excellent communication abilities, enable me to understand and fulfill your data requirements effectively.As a freelancer, I understand the value of meeting deadlines and deliver high-quality output within the agreed timeframe. I can work independently on projects, offering turnkey solutions that drive successful results. Staying updated with the latest developments and features in Microsoft Excel is a commitment I take seriously, always aiming to provide the most current and efficient solutions to my clients.Having worked with various industries, I have a broad outlook that allows me to adapt quickly to new environments and data structures. Whether it's a small business looking to streamline their data management or a large corporation in need of complex data analysis, I take pride in delivering the best possible results.I'm passionate about helping organizations make sense of their data and uncover insights that can propel their growth. So, if you're looking for a reliable, efficient, and professional Microsoft Excel expert, you've come to the right place.Thank you for visiting my profile. I look forward to the opportunity of working together and leveraging the power of data to drive your business forward!