You Don't Need VLOOKUP & XLOOKUP, You Need This | Excel

Versatility
93 followers
Start using a better alternative to the XLOOKUP and VLOOKUP functions in Excel.
👩🏫 Learn more about the Power Pivot and DAX in my course: https://bit.ly/lookups25course
⬇️ Download the example file here and follow along: https://bit.ly/lookups25file
VLOOKUP or XLOOKUP are probably the first formulas you reach for when you need to pull data from one sheet to another in Excel. They work great on small tables, but the moment your file grows, they can slow everything down because they duplicate data.
I'm going to show you exactly why the pros have moved beyond lookup formulas, and the alternative that will change how you work with data forever.
#Excel #ExcelFormulas #ExcelFunctions
0:00 The Problem with VLOOKUP and XLOOKUP in Large Excel Files
1:55 Connecting Data with Excel Tables and the Data Model
3:55 Building Pivot Tables with Relationships and Measures
5:05 Creating Efficient Calculations with PowerPivot Measures
6:45 The Next Step: Automating Data Cleaning with Power Query
This video explains why professional Excel users move beyond VLOOKUP and XLOOKUP in favor of the Data Model and PowerPivot. It demonstrates how connecting tables through relationships instead of duplicating data with formulas prevents file slowdowns and creates a more efficient, database-like system for reporting and analysis.
VLOOKUP or XLOOKUP are probably the first formulas you reach for
when you need to pull data from one sheet to another in Excel.
And they work great on small tables but the moment your file grows
they can slow everything down because they duplicate data.
I'm going to show you exactly why the pros have moved beyond lookup formulas
and the alternative that will change the way you work with data forever.
Here's a pretty common challenge.
Your boss asks you for a sales report showing which products are selling best by region.
We have all the data but it's split across three tables.
We can see the sales data here, then we have products and sales reps.
And going back to the sales data, if you go to the bottom you can see I've got 2,000 transactions
but all we see are cryptic product ID codes
which are not very useful for presentations to management.
So your first instinct is to start building columns
to bring in the product name, category and unit price from the products table
and you might use VLOOKUP or in my case I'll use XLOOKUP.
I'm going to look up the product ID in the products table
and return the product name, category and unit price.
If there's no match, let's return a blank.
Close parentheses and then I need to copy that down.
Let's left click and drag to the bottom.
It won't double click down.
I have to copy and paste and you see it's going to take a few seconds to calculate
because there are so many formulas.
I haven't even calculated the sale value yet so let's do that
which is simply unit price times quantity.
This one I can double click down and before you know it
I've got 8,000 formulas added to my file of which 6,000 contain duplicate data
and we haven't even brought in the sales rep information yet.
Plus each time you add new sales you're going to have to copy these formulas down
so what should be instant starts taking noticeable time.
The solution isn't better lookup formulas, it's thinking like a database.
We need to connect data instead of duplicating it.
Let me show you.
So I'll get rid of these extra columns, ctrl minus to delete them
and instead I'm going to convert the tables into proper Excel tables
with the keyboard shortcut ctrl T.
It's detected my table has headers.
Let's give this table a name, we'll call it sales
and let's rinse and repeat for the products table.
This one's going to be called products and sales reps, we'll call this one reps.
Now here's where the magic happens.
From any table go to the table design tab and then summarize with pivot table.
I'm going to pop it on a new worksheet but here's the key,
you need to check the box add this to the data model before clicking ok.
So you can see it's inserted a new sheet and we've got a pivot table placeholder
but we've only loaded one table to the data model
so let's rinse and repeat for the other tables.
Summarize with pivot table.
I'm going to place this one on the same sheet as the other pivot table
and we'll add it to the data model.
And lastly we'll do the same for the sales reps,
popping it on the same sheet.
Don't worry about these pivot tables, we'll delete them in a moment.
The key here is getting the tables into the data model.
Next we need to open the data model.
You can access it by the data tab under the data model drop down, manage data model.
And this opens the data model aka PowerPivot in a separate window.
You can see at the bottom we've got the three tables and if we go to the diagram view
we can see them all together but they're not related yet.
So to build the relationships we simply left click and drag the columns that we want to connect.
So I want to connect the sales product id to the product id in the products table.
Just left click and drag and release to create the connection.
Likewise the sales rep id is going to connect to the reps table
via the sales rep id in that table.
So we've created our relationships.
I don't need PowerPivot anymore.
I'll close it down and I don't need these extra pivot tables here.
So let's just control minus to get rid of them.
Looking at this first pivot table let's bring the field list over
and I'll make it a bit bigger.
If I go to the all tab you can see I have all three tables I can work with
to build this one pivot table.
I want to see units sold by product name.
Drag the product name into the rows area.
I want to see it by region.
Put that in the columns and let's summarize the quantity.
And then we have the unit sales by product name and region.
Notice what we're not doing.
We're not writing any formulas.
We're not duplicating any data.
Excel's connecting the tables behind the scenes using the relationships we defined.
That's exactly how professional database systems work.
And now you have that power right inside Excel.
We just built a simple three table model with relationships connecting the tables
and that's powerful already but PowerPivot can do even more
like combining data from different sources and running time-based analysis to spot trends.
If you'd like a step-by-step way to build those skills
I've created a PowerPivot course that comes with support and mentoring from me personally.
The link's in the description.
Now let's look at how we can write a custom measure to calculate the sales values.
A measure is just another name for a formula but unlike regular formulas
these ones work inside the pivot table
and they're much more efficient than writing them in the source data.
On the PowerPivot tab under measures we want new measure.
We're going to assign this measure to the sales table and we'll call it sales value.
I'll use the SUMX function and the first argument is the table
and I want the sales table.
The next argument is the expression of calculation.
So I want to calculate the sales quantity times
now I need to multiply this by the unit price but that's in a different table.
So we're going to use the RELATED function to reference the product table unit price.
Close parentheses on RELATED, close parentheses on SUMX.
Let's just check the formula.
Great it's got no errors and then let's set some formatting.
We'll leave it as a decimal number.
Bring it down to no decimal places and use a comma separator for vowsers.
Click OK and you can see it's automatically added that measure to my pivot table.
Let's just remove quantity so it's a bit easier to see
and if we look at the pivot table let's see how many formulas we've actually got.
You can see in the bottom the count of formulas there is only 438
whereas if I'd done this calculation in my source data table
remember I needed to bring in the unit price and then calculate the sales value.
Technically I could have done that in one column
but that would have been another 2000 formulas at a minimum
whereas in the pivot table we did this with 438.
Plus I can easily change the shape of the pivot table.
Let's say I don't want to see it by product name I just want to see it by region
and now we only have six formulas.
With this approach we have a robust efficient analysis and reporting system
that's super easy to use.
Of course PowerPivot requires your data in a clean tabular layout
which our data rarely comes in.
If you've ever wasted hours fixing bad data before you can even start analyzing it
you'll want to see what's next.
So check out this video on automating data cleaning with Power Query in Excel.
It shows you how to get your data ready for analysis in just a few clicks.
I'll see you there.
