Ever found yourself wishing to pull data from one spreadsheet into another based on specific criteria? Excel's XLOOKUP function is a game-changer, making this task a breeze. Let's dive into a step-by-step guide on how to use XLOOKUP to fetch data from one spreadsheet to another.

Before we begin, ensure you're using Excel 365 or Excel 2021, as XLOOKUP is not available in earlier versions. Also, make sure your data is structured in tables for easier reference.

Understanding XLOOKUP Syntax
XLOOKUP's syntax might seem intimidating at first, but it's quite straightforward once you break it down. Here's the basic structure:

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

The value you're searching for in the lookup_array.
For example, if you're looking for the value "John" in the lookup_array, you'd input "John" as the lookup_value.
lookup_array

The range or array where you're searching for the lookup_value.
For instance, if you're searching for "John" in a range of cells A1:A10, you'd input A1:A10 as the lookup_array.
Using XLOOKUP to Fetch Data Between Two Spreadsheets

Now that we've covered the basics, let's put XLOOKUP into action. For this example, let's assume we have two spreadsheets: 'Sheet1' and 'Sheet2'.
In 'Sheet1', we have a table of employee names and their respective departments. In 'Sheet2', we want to display the department of each employee based on their name.



















Preparing Your Data
First, ensure your data is structured in tables. In 'Sheet1', select your data and go to the 'Home' tab, click on 'Format as Table'. In 'Sheet2', create a new table with the employee names you want to look up.
For this example, let's assume 'Sheet1' has the following data:
| Name | Department |
|---|---|
| John | IT |
| Jane | HR |
| Mike | Finance |
Using XLOOKUP to Fetch Data
In 'Sheet2', suppose you want to find the department of 'John' and 'Jane'. In cell B2, enter the following formula:
=XLOOKUP(A2, Sheet1!A:A, Sheet1!B:B)
Here, 'A2' is the lookup_value, 'Sheet1!A:A' is the lookup_array, and 'Sheet1!B:B' is the return_array.
Press Enter, and you should see 'IT' appear in cell B2. Drag this formula down to copy it for other cells, and you'll see the departments for 'Jane' and any other names you've listed.
And there you have it! You've successfully fetched data from one spreadsheet to another using XLOOKUP. This function is incredibly versatile and can save you a lot of time and effort in your data analysis tasks.
Remember, practice makes perfect. The more you use XLOOKUP, the more comfortable you'll become with its syntax and capabilities. Happy Excel-ing!