Microsoft Excel · Formulas · Practical Learning

XLOOKUP in Excel: 10 Powerful Examples with Step-by-Step Formulas

Learn XLOOKUP in Excel through ten practical examples covering employee records, product lookups, multiple matching conditions, dynamic arrays, approximate matches, invoice transactions and business reporting calculations.

XLOOKUP is one of the most flexible lookup functions available in modern Microsoft Excel. It allows you to search for a value in one range and return related information from another range. It can search vertically or horizontally, retrieve data from either side of the lookup column and handle missing values more conveniently than traditional lookup formulas.

In this comprehensive tutorial, Bikash Sarangi, founder of TechBikash28 and Kalpavriksh Software, explains how XLOOKUP works through realistic business scenarios. Every formula is accompanied by sample data, expected results and a detailed explanation.

10 Practical Examples XLOOKUP vs VLOOKUP Multiple Criteria SUM + XLOOKUP By Bikash Sarangi
XLOOKUP in Excel step-by-step tutorial with practical examples by Bikash Sarangi
Learn XLOOKUP in Excel with practical formulas and business examples on TechBikash28.

What You Will Learn in This Tutorial

  • Understand the six XLOOKUP arguments
  • Retrieve employee details using Employee ID
  • Compare XLOOKUP and VLOOKUP
  • Return several columns from one formula
  • Search multiple employee IDs together
  • Apply two or three lookup conditions
  • Retrieve the last matching transaction
  • Search product descriptions using wildcards
  • Apply discounts using approximate matching
  • Perform two-way and SUM calculations

Recommended audience: Excel beginners, data analysts, MIS executives, accountants, HR teams, finance professionals, inventory managers and students.

02 · Understanding XLOOKUP

What Is XLOOKUP in Excel?

XLOOKUP is a lookup and reference function that searches a specified row or column for a lookup value. When the value is found, it returns information from the corresponding position in another selected range.

For example, an HR executive may maintain employee IDs, names, departments and salaries in one worksheet. By entering only an Employee ID, XLOOKUP can retrieve the corresponding name, department or salary. This helps avoid manually searching through hundreds of records.

XLOOKUP Formula Syntax

=XLOOKUP(lookup_value,lookup_array,return_array,[if_not_found],[match_mode],[search_mode])
Argument Meaning Required
lookup_value The value you want to find Yes
lookup_array The search range Yes
return_array The values to return Yes
if_not_found Optional message if no match exists No
match_mode Exact, approximate or wildcard matching No
search_mode Search direction or binary search method No

Match Mode and Search Mode

Exact matching is the default. Match mode -1 allows an exact match or the next smaller value, while match mode 1 allows an exact match or the next larger value. Match mode 2 enables wildcard searches involving asterisks and question marks.

Search mode -1 tells Excel to search from the last record toward the first. This is useful when a list contains repeated customer or product values and you need the last matching entry.

Software compatibility: XLOOKUP is supported in Microsoft 365, Excel 2021 and Excel 2024. It is not available as a native function in Excel 2016 or 2019. Some examples in this article also require modern dynamic-array functionality.

03 · Prepare the Practice Data

Sample Excel Data for XLOOKUP Examples

Before learning advanced formulas, we will prepare two fictional datasets. The first contains employee details, while the second contains product information. These tables will be used throughout the first four examples.

Employee Master

Create a worksheet with the following columns in A1:E1. Enter the employee records in rows 2 to 7.

Employee ID Name Department Designation Salary (₹)
1001AshaSalesAnalyst48,000
1002RaviFinanceExecutive52,000
1003NehaOperationsManager65,000
1004KabirHRSpecialist45,000
1005MeeraSalesManager72,000
1006IshanITDeveloper60,000

Product Master

Create a separate worksheet containing the following product information in cells A1:D6.

Product Code Product Name Category Price (₹)
P101LaptopComputers58,000
P102Wireless MouseAccessories850
P103KeyboardAccessories1,200
P104MonitorDisplays12,500
P105USB HubAccessories1,600

Practice arrangement: Each example below should be treated as a separate worksheet. Place the specified source data in columns A onward and the lookup input cells in column H. This prevents example-specific formulas from interfering with one another.

Beginner
01

Basic XLOOKUP to Find Employee Details

The most common use of XLOOKUP is retrieving information using a unique identifier. In an employee database, Employee ID is usually a better lookup field than Employee Name because different employees may share the same name.

Use the Employee Master in A1:E7 and enter Employee ID 1005 in H2. We will retrieve the employee name and salary separately.

Find Employee Name

=XLOOKUP(H2,$A$2:$A$7,$B$2:$B$7,"Employee not found")
Employee Name Meera

Excel searches column A for the ID entered in H2. When 1005 is found, the corresponding name from column B is returned.

Find Employee Salary

=XLOOKUP(H2,$A$2:$A$7,$E$2:$E$7,"Employee not found")
Monthly Salary ₹72,000

The lookup range remains the same, but the return range changes from column B to column E. This allows a single employee identifier to retrieve different information fields.

If you enter a missing Employee ID, the formula displays "Employee not found". This is easier for users to understand than a raw #N/A error.

Beginner
02

XLOOKUP vs VLOOKUP: Left and Right Lookup

VLOOKUP has been widely used for Excel reporting for many years. However, it searches the first column of its selected table and returns data using a column index.

XLOOKUP uses separate search and return ranges. This makes formulas easier to read and allows information to be retrieved from either side of the lookup column.

Use the Product Master in A1:D6 and enter Product Code P103 in H2.

VLOOKUP Formula

=VLOOKUP(H2,$A$2:$D$6,4,FALSE)

Equivalent XLOOKUP Formula

=XLOOKUP(H2,$A$2:$A$6,$D$2:$D$6,"Not Found")
Price of P103 ₹1,200

Both formulas return the price of Keyboard. VLOOKUP uses column index 4, while XLOOKUP directly identifies the price column.

Retrieve a Value from the Left

Enter Wireless Mouse in H3. The task is to retrieve its Product Code from column A, which is located to the left of Product Name in column B.

=XLOOKUP(H3,$B$2:$B$6,$A$2:$A$6,"Not Found")
Product Code P102

This ability is particularly useful when a business worksheet cannot be reorganized simply to accommodate a lookup formula. The original column order can remain unchanged.

Intermediate
03

XLOOKUP to Return Multiple Columns

Sometimes one lookup must return several pieces of information. An HR report may require Employee Name, Department, Designation and Salary for one selected Employee ID.

You do not always need to write four different formulas. XLOOKUP can return multiple adjacent columns from a matching record.

Use the Employee Master. Enter 1003 in H2 and place the following formula in I2.

=XLOOKUP(H2,$A$2:$A$7,$B$2:$E$7,"Not Found")
Name Department Designation Salary
Neha Operations Manager 65,000

Because the return range includes four columns, Excel returns four corresponding values from the matching row. The results spill horizontally from I2 through L2.

Important: The spill destination cells must be empty. If any cell in the required output range already contains information, Excel may display #SPILL!.

Intermediate
04

XLOOKUP with Multiple Lookup Values

Business reports frequently require matching several IDs at once. For example, an HR manager may receive a list of employees selected for a training program. The manager needs to retrieve their names from the master employee database.

Enter the Employee IDs 1002, 1005, 1001 and 1006 into H2:H5. Then enter the formula below in I2.

=XLOOKUP(H2:H5,$A$2:$A$7,$B$2:$B$7,"Not Found")
Employee ID Employee Name
1002Ravi
1005Meera
1001Asha
1006Ishan

A dynamic-array-enabled Excel version processes the list of lookup values and returns the matching employee names vertically. This reduces the need to create separate formulas for every ID.

This technique is useful for employee allocation, customer verification, inventory identification and bulk record matching. It is especially convenient when the number of search values changes regularly.

Intermediate
05

XLOOKUP with Multiple Criteria

A product may have different prices for different customers or geographical regions. Searching only for Product Code might return the wrong price because the product appears several times in the price master.

In this example, we will match three conditions: Customer, Product Code and Region.

Customer Product Region Price (₹)
OrionP101West56,500
OrionP101East57,500
OrionP102West790
ApexP101West56,200
ApexP102East820
ZenithP104West11,900

Enter the dataset into A1:D7. Set H2 to Orion, H3 to P101 and H4 to West.

=XLOOKUP(1,($A$2:$A$7=$H$2)*($B$2:$B$7=$H$3)*($C$2:$C$7=$H$4),$D$2:$D$7,"No matching price")
Matching Customer Price ₹56,500

The formula performs three separate comparisons for every record. Each comparison generates TRUE or FALSE. Multiplication converts these logical results into 1 and 0.

A row returns 1 only when every condition is satisfied. XLOOKUP searches for that 1 and retrieves the corresponding price. This is useful for price lists, rate contracts, procurement schedules and multi-condition master data.

When several rows satisfy the same combination of conditions, ordinary XLOOKUP returns the first matching row. Ensure that the price master is unique or add further conditions where necessary.

Intermediate
06

Find the Last Matching Record Using XLOOKUP

By default, XLOOKUP searches from the beginning of the lookup array and returns the first match. However, operational reports sometimes require the last recorded transaction for a customer or product.

The reverse search option allows Excel to begin from the bottom of the selected range. This can help retrieve the latest recorded status when the transaction data is correctly ordered by date.

Date Invoice Customer Status Amount (₹)
01-Oct-2026INV001OrionSent25,000
03-Oct-2026INV002ApexPaid18,000
08-Oct-2026INV003OrionOverdue35,000
12-Oct-2026INV004ZenithPaid22,000
18-Oct-2026INV005OrionPaid12,000
21-Oct-2026INV006ApexSent26,000

Enter the table in A1:E7 and enter Orion in H2. Use the following formula.

=XLOOKUP(H2,$C$2:$C$7,$D$2:$D$7,"Not Found",0,-1)
Last Recorded Status Paid

Search mode -1 makes Excel search from the last row toward the first. The last Orion record in the displayed dataset has the status Paid.

The last matching row is only the most recent record if the data is correctly ordered. If the table is unsorted, use a date-based approach or sort the transaction list first.

Intermediate
07

XLOOKUP with Wildcards and Partial Text

Users do not always remember a complete product name. Someone working in a warehouse may know only that an item contains the word Mouse, Monitor or Keyboard.

XLOOKUP supports wildcard matching for text searches. The asterisk represents any number of characters, while the question mark represents one character.

Use the Product Master in A1:D6 and enter mouse in H2.

=XLOOKUP("*"&H2&"*",$B$2:$B$6,$A$2:$A$6,"Not Found",2)
Matching Product Code P102

The formula creates the search pattern *mouse*. Match mode 2 enables wildcard matching, allowing the formula to locate Wireless Mouse even though the user entered only part of the name.

This technique is practical for inventory descriptions, item masters, supplier lists and product catalogues. However, XLOOKUP still returns the first qualifying match. Use FILTER when you need all matching products.

Intermediate
08

XLOOKUP Approximate Match for Discounts

Approximate matching is useful when a result depends on a numerical band rather than a precise value. Common examples include discount structures, incentives, commission percentages and performance grades.

Suppose a company offers different discount rates depending on the customer's total purchase value. The discount table contains minimum sales thresholds.

Minimum Sales (₹) Discount Rate
00%
50,0002%
1,00,0005%
2,00,0008%
3,00,00010%

Enter the table in A1:B6 with actual percentage values in column B. Enter sales of ₹1,75,000 in H2.

=XLOOKUP(H2,$A$2:$A$6,$B$2:$B$6,"No Band",-1)
Applicable Discount 5%

Match mode -1 searches for an exact value or the next smaller threshold. Because ₹1,75,000 falls between ₹1,00,000 and ₹2,00,000, the rate for ₹1,00,000 is selected.

Calculate Discount Amount

If the returned discount percentage is stored in H3, enter this formula in H4.

=H2*H3
Discount Amount ₹8,750

The formula calculates 5% of ₹1,75,000. This approach can be extended to other tier-based business calculations, provided the thresholds reflect the applicable policy.

Advanced
09

Two-Way XLOOKUP with Nested Formulas

A two-way lookup retrieves a value using both a row heading and a column heading. For example, management may want to view February sales for one selected product from a monthly sales report.

Nested XLOOKUP formulas allow Excel to identify the correct month column and then the corresponding product row.

Product Jan Feb Mar
P1011,50,0001,70,0001,60,000
P10225,00031,00028,000
P10338,00042,00049,000
P10467,00071,00073,000

Enter the monthly sales matrix in A1:D5. In H2 enter Product P103 and in H3 enter Feb.

=XLOOKUP(H2,$A$2:$A$5,XLOOKUP(H3,$B$1:$D$1,$B$2:$D$5),"Not Found")
P103 Sales in February ₹42,000

The inner XLOOKUP searches the month headings and returns the February column. The outer XLOOKUP searches for P103 and retrieves its corresponding value from that selected column.

Two-way lookups are useful for monthly revenue, production performance, budget comparisons, departmental targets and other matrix-based reporting systems.

Advanced
10

SUM with XLOOKUP: Multiple Values and Records

A common question is whether XLOOKUP can calculate totals. The answer depends on whether you want to add several values from one matching record or total multiple transaction rows.

Method A: SUM with XLOOKUP

Use the monthly sales matrix from Example 09. We want the combined January, February and March sales for Product P101.

Enter P101 in H2.

=SUM(XLOOKUP(H2,$A$2:$A$5,$B$2:$D$5,0))
Total Sales for P101 ₹4,80,000

XLOOKUP returns the three monthly sales values for P101: ₹1,50,000, ₹1,70,000 and ₹1,60,000. SUM adds these returned values to calculate ₹4,80,000.

Method B: Sum All Matching Transaction Rows

Consider a customer who has several invoices. Searching for the customer through ordinary XLOOKUP returns one matching record, not the sum of every invoice.

Customer Invoice Amount (₹)
OrionINV10112,500
ApexINV10218,000
OrionINV1037,300
ZenithINV1049,000
OrionINV1055,400

Enter this transaction table in A1:C6. Enter Orion in H3.

=SUMIFS($C$2:$C$6,$A$2:$A$6,$H$3)
Total Invoice Value for Orion ₹25,200

SUMIFS checks every transaction row that matches Orion and adds ₹12,500, ₹7,300 and ₹5,400. The result is ₹25,200.

Key learning: Use SUM with XLOOKUP to add several values returned from one matching record. Use SUMIFS when you need to total all transaction rows satisfying the specified criteria.

14 · Troubleshooting

Common XLOOKUP Errors and Their Solutions

Even correctly written formulas can produce unexpected results when source data contains missing IDs, inconsistent data types, duplicate keys or blocked output cells. The most reliable approach is to identify the cause instead of simply hiding every formula error.

#N/A — No Matching Value

Check whether the lookup value exists in the source. Review leading spaces, different data types and incorrect identifiers. Use if_not_found for an appropriate missing-value message.

#SPILL! — Blocked Array Output

Dynamic-array formulas need empty output cells. Remove any information blocking the spill range. Enter the spilling formula in the normal worksheet grid rather than inside an Excel Table calculated column.

#VALUE! — Incorrect Dimensions

Check that the lookup array and return array have compatible dimensions. For a vertical lookup, their row counts must correspond correctly.

#NAME? — Unrecognized Function

Check the spelling of XLOOKUP and verify the Excel version. Older versions such as Excel 2016 and 2019 do not provide native XLOOKUP.

Incorrect Result from Duplicate IDs

XLOOKUP returns the first match by default. Consider using a unique identifier, additional matching conditions or reverse search depending on the requirement.

Incorrect Approximate Match

Confirm whether the business calculation needs the next smaller or next larger value. Avoid binary search modes unless the source range is sorted correctly.

Best Practices for XLOOKUP Formulas

  • Use unique IDs whenever possible
  • Keep lookup columns free from unnecessary spaces
  • Apply absolute references to fixed data ranges
  • Use consistent number and text formats
  • Check duplicate values before relying on the first match
  • Use appropriate error handling for missing records
  • Choose SUMIFS when every qualifying row must be totaled
  • Verify formulas using small datasets before deployment

For additional technical documentation, refer to Microsoft Support — XLOOKUP Function .

15 · Frequently Asked Questions

XLOOKUP in Excel: Frequently Asked Questions

1. What is XLOOKUP used for?

XLOOKUP searches a specified range and returns information from the corresponding position in another range. It is commonly used in employee, product, customer and transaction databases.

2. Is XLOOKUP better than VLOOKUP?

XLOOKUP is generally more flexible because it supports left and right lookups, exact matching by default, custom missing-value results and multiple return columns.

3. Can XLOOKUP use multiple criteria?

Yes. Combine Boolean comparisons for several columns and use the resulting array to find the row where all conditions are satisfied.

4. Can XLOOKUP return multiple columns?

Yes. Select a multi-column return range to retrieve adjacent values from the same matching record. The formula may spill into several cells.

5. Can XLOOKUP find the last match?

Yes. Use search mode -1. It searches the source range from the bottom upward and returns the last matching entry.

6. Can XLOOKUP calculate a total?

SUM can aggregate numeric values returned by XLOOKUP. However, use SUMIFS when you need to total amounts across every matching transaction row.

7. Can XLOOKUP find partial text?

Yes. Enable wildcard matching using match mode 2 and the appropriate wildcard symbols.

8. Is XLOOKUP available in Excel 2019?

No. Native XLOOKUP is not available in Excel 2016 or 2019. Use a supported modern version of Excel.

9. Why does XLOOKUP return #SPILL!?

A formula returning multiple values cannot place its results when destination cells are blocked. Clear the required spill range.

10. Can XLOOKUP replace INDEX and MATCH?

Many traditional INDEX and MATCH lookup tasks can be handled using XLOOKUP. However, the appropriate choice depends on workbook compatibility and the calculation being performed.

16 · Video Learning

Watch the Excel XLOOKUP Video Tutorial

Reading formulas provides a useful foundation, but watching the actual Excel workflow can make the concepts easier to understand. The original TechBikash28 XLOOKUP article linked to the video below.

Excel XLOOKUP Learning Video

Open original video on YouTube →

A new companion video can demonstrate all ten examples from this article using the same practice workbook. The workbook will help viewers follow each formula, modify inputs and compare the calculated results against expected values.

17 · Practice Resources

Free XLOOKUP Excel Practice Workbook

The ten examples in this tutorial are designed to become a reusable Excel exercise workbook. Each worksheet will contain its own source data, input fields, formulas and expected results.

Planned Workbook Contents

  • Employee and Product Master tables
  • Ten independently prepared XLOOKUP exercises
  • Formula explanations and expected outputs
  • Editable lookup input cells
  • Practice questions for learners
  • TechBikash28 learning notes and video references

Workbook: TechBikash28_XLOOKUP_10_Practical_Examples.xlsx

Status: The Excel practice workbook will be linked here once it has been prepared and uploaded to the website.

18 · Visual Learning

Explore XLOOKUP and Excel Web Stories

TechBikash28 also provides short visual learning guides. These Web Stories introduce useful Excel functions, reporting techniques and practical methods through illustrated learning sequences.

20 · Conclusion and Author

Conclusion: Why Learn XLOOKUP in Excel?

XLOOKUP is an important modern Excel function for professionals working with structured information. It can simplify routine lookups, reduce dependence on hardcoded column indexes and support more flexible reporting methods.

In this tutorial, we covered basic employee lookups, VLOOKUP comparisons, multiple return values, multiple conditions, reverse searching, wildcard searches, approximate matching, two-way lookups and SUM calculations.

Each technique addresses a different problem. The correct method depends on whether you need one matching record, several returned columns, a numerical band or the total of multiple transactions. Understanding that distinction is essential for accurate Excel reporting.

Practise the examples using small datasets first. Once you understand how the formulas behave, apply the same principles to larger business tables, finance reports, procurement records, HR databases and inventory systems.

About Bikash Sarangi

Bikash Sarangi is the founder of TechBikash28 and Kalpavriksh Software. His professional experience includes data analytics, Power BI, Microsoft Excel, Google Apps Script, reporting automation and custom business application development.

TechBikash28 is a technical learning and knowledge-sharing platform focused on helping learners understand real-world technology applications. Through practical tutorials, formulas, code examples and video lessons, the platform supports students, working professionals and technology learners.

For professional Power BI, reporting automation and software implementation services, visit Kalpavriksh Software.

↑ Back to Article Introduction
Bikash

Main Office

Bhubaneswar, Odisha

ofc: 309-RECIC, Bhubaneswar, Odisha 751017

+91-7978288532

+91-7978288532

Useful Links

Home
Services
Our Team
About Us
Price
Gallery

Scroll to Top