XLOOKUP Formula in Excel with Example
XLOOKUP Formula in Excel with Example

XLOOKUP Formula in Excel with Example for Beginners

Introduction

If you still use VLOOKUP in Excel, you are probably spending more time fixing formulas than actually analyzing data. That is exactly why the XLOOKUP Formula in Excel became one of the most important Excel upgrades in recent years.

I still remember the first time I used XLOOKUP while managing a student marks sheet. One wrong column number in VLOOKUP broke the entire sheet. After switching to XLOOKUP, the process became faster, cleaner, and much easier to understand.

Whether you are a student, office worker, freelancer, or beginner learning Excel, XLOOKUP can save hours of manual work. It helps you search for values quickly, return matching information, and reduce formula errors.

In this guide, you will learn:

  • What XLOOKUP is
  • Why it is better than VLOOKUP
  • XLOOKUP Formula syntax
  • Beginner-friendly examples
  • Real-world practical uses
  • Common mistakes to avoid
  • Advanced tips in simple language

What is XLOOKUP in Excel?

The XLOOKUP Formula in Excel is a modern lookup function used to search for data in a table or range.

It can:

  • Search vertically or horizontally
  • Return exact matches by default
  • Search from left to right or right to left
  • Replace both VLOOKUP and HLOOKUP
  • Handle missing values more cleanly

Microsoft introduced XLOOKUP to make lookup formulas easier and more powerful.

You can learn more from the official Microsoft Excel Support documentation.


Image: Understanding XLOOKUP Basics

https://images.openai.com/static-rsc-4/rCKMyYyhAC02skGF2LIuLGmlPZYubmiUkn2avCFUxN7Y_YnWd4CeiJ7_edPHJFMZO9sZ1o1H-5A7NV-dHfajL1I_WymqsSqIsmy_9ODclC56jFQsHRlyTOuYcnU9r60wkZEl7I9K8lt7kr2xvrPCNP5JubveQpjGabpwoFCUzWDEVHt9TnvEfxM12JPyJAJv?purpose=fullsize
https://images.openai.com/static-rsc-4/LZADYu2sr1VaHoVyawuCpw-mBq7K4IYkex5ymB1P2OzYXJyaC92OuoEzOn0KB0DiAfh9k7mJ5pjVeK-KUAAQx5qXM6BEfot36LAAvW4uxX7E4MEWJ41vvvyLfRI_O_D06lP5u6Z5e1Jyrybypg5w6JLXb5WJ3aE-CjKL-hZvBFjyvrsImptcroqSC__lILM0?purpose=fullsize
https://images.openai.com/static-rsc-4/w8ZJkjRgIhd20-JZTsjhqMfEKykRGPZpL02mliNOZTyfPRkWo3dfBXrjFV-gGS9jw82-9aYK_NfxS3DqbBNB_yQyTGxfCMvTxyFq7cMwtfK9TopoH2hB5d9iLJ5Z309geqlOPoy6fHRtG4MDbWOnVpm-dG64SA2ScFOXDocR1gYloxxJNIB7bvqCckpZBV-U?purpose=fullsize

6


Why Beginners Love XLOOKUP

Here is why most Excel users now prefer XLOOKUP:

FeatureVLOOKUPXLOOKUP
Searches left to rightYesYes
Searches right to leftNoYes
Exact match defaultNoYes
Easier syntaxMediumEasy
Column number requiredYesNo
Error handlingDifficultSimple

The biggest advantage is simplicity. You no longer need to count columns manually.


XLOOKUP Formula Syntax

Here is the basic syntax:

XLOOKUP(lookup_value,lookup_array,return_array,[if_not_found],[match_mode],[search_mode])\text{XLOOKUP}(lookup\_value,lookup\_array,return\_array,[if\_not\_found],[match\_mode],[search\_mode])XLOOKUP(lookup_value,lookup_array,return_array,[if_not_found],[match_mode],[search_mode])

Explanation of Each Argument

ArgumentMeaning
lookup_valueThe value you want to search
lookup_arrayThe column or row containing the value
return_arrayThe data you want returned
if_not_foundOptional message if no match exists
match_modeControls exact or approximate matching
search_modeControls search direction

At first, the formula may look long, but in practice it is easier than VLOOKUP.


Simple Student Marks Example

Imagine you have this Excel table:

Student NameEnglishMathScience
Ali788580
Sara908891
Ahmed677270

Now you want Excel to return Sara’s Math marks automatically.

Use this formula:

=XLOOKUP(Sara,A2:A4,C2:C4)=XLOOKUP(“Sara”,A2:A4,C2:C4)=XLOOKUP(“Sara”,A2:A4,C2:C4)

Result:

88

This formula tells Excel:

  • Search for “Sara”
  • Look inside cells A2:A4
  • Return the matching value from C2:C4

That is it.


Image: Student Marks XLOOKUP Example

https://images.openai.com/static-rsc-4/eJ5QHLbZKy2uzQtP-ibgJIHAItlCQDAF3A1xA69bQfogbc8g98FaabZs-z1fm5cHWE40Oe-IftpVIUcaECMHWmOwxdIMK9AgpDPtGeAYLClE6eJ4pKHPMPp20AuwaH6qCCq97O_EMQCjlXeh4_73z5_98TGen9h_UYnYZIpgUCJ2jdrfMUXjAvYoHVvhNGQW?purpose=fullsize
https://images.openai.com/static-rsc-4/SfmLde0wFuwQG1gx8zy9xiyNXfgqMt9FF5XzNXfxGKVVnMo4PD-YxpnOAAzvAVNr2SKgEwYZqudFeaTd9lp81EWn78VC3MXYxH6_FgAEWpWEUxtbpWYYrV2U5IhPzzdyGqzgv93qFrIxGLNOO3tfKgm8RSojMCg5iOuVBFytufk-u0injNPsj96hOuFuWhcR?purpose=fullsize
https://images.openai.com/static-rsc-4/qTXB4rFM9AkuB_eL3UXMQg7ZWAmunHNu1-AUl5KB_QoJETbb1QvA6-h9_QgZwJ9jxLrLE0R_jlQUqkMZ2O_IbaxkJFkqOKu6FFhekljhLxVMHtggNEqEf-yfsh7gES3mbczLtcKilxVhjzjBL46yH6lFzNWktSCs4hBkPXlPRpTv4B_J9xua069vNk-EViYv?purpose=fullsize

6


Step-by-Step Guide to Use XLOOKUP

Step 1: Prepare Your Data

Organize data in columns properly.

Example:

IDEmployee NameSalary
101Hamza50000
102Bilal65000
103Ayesha72000

Clean data makes formulas more accurate.


Step 2: Select the Result Cell

Click the cell where you want the result to appear.

Example: E2


Step 3: Enter the Formula

=XLOOKUP(102,A2:A4,C2:C4)=XLOOKUP(102,A2:A4,C2:C4)=XLOOKUP(102,A2:A4,C2:C4)

Excel searches for ID 102 and returns the salary.

Result:

65000


Step 4: Press Enter

Excel instantly displays the matching value.

That is the beauty of XLOOKUP.


Using XLOOKUP with “Not Found” Message

One of the most useful features is custom error handling.

Instead of showing ugly errors like:

#N/A

You can display a friendly message.

Example:

=XLOOKUP(Usman,A2:A4,B2:B4,StudentNotFound)=XLOOKUP(“Usman”,A2:A4,B2:B4,”Student Not Found”)=XLOOKUP(“Usman”,A2:A4,B2:B4,”StudentNotFound”)

If Usman does not exist in the table, Excel will display:

Student Not Found

This looks far more professional in reports.


Image: XLOOKUP Error Handling

https://images.openai.com/static-rsc-4/rvOe0rprem2hCFjaOwQxDWo933u6cKFa5NWgBtI_LjOz6tH2lUIKghiEcvhLy50CyA0KLj0VdKN5G2-YTaCMChTCFb_Hws92dVKx1FsTDf40KC8BvGVC5F-Sbh429opGGgqOUW2ReKWMocYLZl7wkmnu-_M13mlOm_YSIWHZLFVg5R6lOz6EVSrRRSdI-nhk?purpose=fullsize
https://images.openai.com/static-rsc-4/PAg3gjH5g2ZjTXMTukRI4Yorf0RIdOS4KgzkMyP3rm5J1a5mT7caRItVvin5h-hbQDdSu6IIEU3RlneDa4PYjXljL8E5DnFKtnfbMyKFkTrL4eqSNeZUsOzeGsYhdG8hm_CmVPmssgz9MzSBIVo_S4zlmgm7bA88hIRaoCFIA3pRvREbjW7zRr5H0gu67ahu?purpose=fullsize
https://images.openai.com/static-rsc-4/KFlkgQsuGJ54UWX9dRzl2ykmNLwFAOoQHDIlSNQ_GY9O3hLg2ul6jscmP3v2MyxmUXYI-BhTHCzmfyNTbFzZ_FfMy0LFSsd0-VKUvbjj2sb5Z5vHMiWhsfk4-M4J4gTBmO3K3-W8sTD1NaJtulIpRY5Qptz1CGvbG6uGNDraT0g2bh5jaBOdMbEZz7eY-rdF?purpose=fullsize

6


XLOOKUP vs VLOOKUP

Most beginners ask:

“Should I learn VLOOKUP first?”

The short answer is: learn XLOOKUP first if your Excel version supports it.

Why XLOOKUP is Better

1. No Column Number Counting

VLOOKUP requires column index numbers.

Example:

=VLOOKUP(A2,B2:E10,3,FALSE)

XLOOKUP is cleaner:

=XLOOKUP(A2,B2:B10,D2:D10)

2. Searches in Any Direction

VLOOKUP only searches left to right.

XLOOKUP can search both directions.


3. Exact Match by Default

VLOOKUP can produce wrong results if FALSE is forgotten.

XLOOKUP avoids this issue.


4. Easier Maintenance

If columns move, XLOOKUP formulas usually continue working.

That saves a lot of frustration.


Real-World Uses of XLOOKUP

The XLOOKUP Formula in Excel is not just for students. Businesses use it daily.

Office Work

  • Employee records
  • Salary lookups
  • Attendance sheets

Sales & Inventory

  • Product prices
  • Stock management
  • Invoice automation

Education

  • Student marksheets
  • Attendance tracking
  • Grade calculation

Freelancing

  • Client databases
  • Payment tracking
  • Reporting dashboards

Image: Real-World XLOOKUP Uses

https://images.openai.com/static-rsc-4/Pi8ml9zglyxYs1KomjjYAgw_vvdmVoi6dtOakMiAygr7Gkx1WdftMdZF4KKV9rBQ4xG56Owe-Rm9eE3YL59rczA8LS7Legl4biXY70UUbZGBaH5jr2u158gMaKyR5OERf_XO5GDivcwQeF2OhsLYsQyoBYLYSKs8lJqK-xsQLrafoXXuiRbYW-GxqTpLL8sx?purpose=fullsize
https://images.openai.com/static-rsc-4/owf5D9A_He0Gf9RjfKhuBnlvPeuhAMQC93XtQ9h0SQASB9V3JD_ESk29fNtdXwShBtXuO9Ot8HcwQW4EOuPn-cPVut5_BKWbuoVM_AVWqadX3Cuznhw1rQW6pXLC7HHbXzrnuSIwPFCCM-jEFp3Gus4vf0yNGIEYDecxriR44WZgHRx5EDHf-BC2BY8uBJIU?purpose=fullsize
https://images.openai.com/static-rsc-4/yZqzA8eb021HVWkQ1ccKZoqDTsO07UKmGWR0xrjbOgjL7Y6sx6ztmkU9spZPpMuDc4lZZOYlpaXSKRfGr0qC5u-sQsGs2i3ilwnoEeO0V30j-BFo0biNk-gWeezHiOUImk-_USUFdySBW01MfTbII2dEIf3EpHU3cnmipfUlg9qtSk_kbpOw9MCzefpcPuZg?purpose=fullsize

6


Advanced Beginner Tips

Use Named Ranges

Instead of:

A2:A100

Use named ranges like:

EmployeeIDs

This makes formulas easier to read.


Combine with IFERROR

Although XLOOKUP already handles errors well, combining formulas can create cleaner spreadsheets.


Use Dynamic Tables

Excel Tables automatically expand when new data is added.

This keeps XLOOKUP formulas flexible.


Common XLOOKUP Mistakes

1. Different Range Sizes

Wrong:

=XLOOKUP(A2,B2:B10,C2:C5)

The arrays are different sizes.

Always keep ranges equal.


2. Extra Spaces in Data

Sometimes “Ali ” and “Ali” look identical but are different because of spaces.

Use:

TRIM()

to clean data.


3. Using Older Excel Versions

XLOOKUP works in:

  • Excel 365
  • Excel 2021
  • Modern Excel Online versions

Older versions may not support it.

You can check compatibility on Microsoft Office Official Website.


Practical Mini Project for Beginners

Try building this simple project:

Student Result Finder

Create columns:

Roll NoNameTotal Marks
1Ali450
2Sara480
3Ahmed390

Now create a search box.

When you type a student name, XLOOKUP automatically returns marks.

Formula:

=XLOOKUP(F2,B2:B4,C2:C4,NoRecord)=XLOOKUP(F2,B2:B4,C2:C4,”No Record”)=XLOOKUP(F2,B2:B4,C2:C4,”NoRecord”)

This small project teaches real-world Excel automation.


Image: Beginner Excel Mini Project

https://images.openai.com/static-rsc-4/kEhcl70LD9JnXsG3-kID7wsAx4GfBpgsBf9pPOFaCcy3BPzC-A8BWlA4OYgzuLwVAn-VIuuvrmu80pLB-GTprYYyLRm3qSZL4IyRIpPmJjU_iOBJd7uEa1YODf-RwaIsysGoVCfjyvHq3kXdd7Z1JbcyDGDNl4nvQ_RNADuAudaxksZwQWaqPL4F4MGPm0ob?purpose=fullsize
https://images.openai.com/static-rsc-4/QaHodWYSGNJ5gEgieiOVt17IcAS247sgxe-nZZ3VF0JtOPLkFpfuPtQdWAVM-gpq24UdP4n87WsW-YW_E8VLnWv3P8fGad1VCYxANrQ5n4-Lm7DQCzn8C0uMdo-dUzYZ4pRXQZIzoz2J72cz3qpFzhu5Da6X0i7vcXYe5mslGihbVaQWpN7TNgbtAdp1Htya?purpose=fullsize
https://images.openai.com/static-rsc-4/BxIvkpDqGe82-DqrZ3TliOdNJHzV5_HMpbcDPlXaSx1Zm22LzY49EHZGBOT4S1Byt_ebslJ8SoLxwroPT92X1xDkLHL741LHA-_dGUtoovCnFqxM8SlpAhhz_JzvOFbeP5di4wngnBj7-5bC4fwu2xLIiFBNyCVWBM3KjnTpdRUVGxdFaZ-i2tS7u02dMvry?purpose=fullsize

4


Best Practices for Using XLOOKUP

Keep Data Organized

Messy spreadsheets create formula errors.


Use Tables Instead of Random Ranges

Tables improve readability and automation.


Test with Small Data First

Practice with 5–10 rows before large datasets.


Learn Keyboard Shortcuts

Excel becomes much faster when combined with shortcuts.

Useful resource:


Final Thoughts

The XLOOKUP Formula in Excel is one of the easiest ways to make your spreadsheets smarter and more professional.

For beginners, it removes many frustrations caused by older lookup formulas. Instead of memorizing complicated syntax, you can focus on solving real problems faster.

Once you understand XLOOKUP, you will notice a huge improvement in:

  • Speed
  • Accuracy
  • Spreadsheet organization
  • Confidence using Excel

Start with simple examples, practice daily, and gradually use XLOOKUP in real projects like marksheets, employee records, or inventory tracking.

That is how Excel skills grow naturally.

Conclusion

Learning the XLOOKUP Formula in Excel is one of the smartest decisions for anyone working with spreadsheets. It simplifies data searching, reduces errors, and makes Excel far more powerful for everyday tasks.

The best part is that you do not need advanced Excel knowledge to start using it. Even beginners can create professional spreadsheets within minutes.

Now it is your turn.

Open Excel, create a small table, and practice the examples from this guide. The more you experiment, the faster you will master XLOOKUP.

If you found this guide helpful, share it with friends or coworkers who are learning Excel, and explore more beginner Excel tutorials to continue improving your skills.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

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