馃攳
How to use Excel Index Match (the right way) - YouTube
Channel: Leila Gharani
[5]
In this lecture, I'm going to show you how
you can use index and match to solve complex
[10]
lookup problems.
[12]
The thing with INDEX and MATCH is that it's
not a VLOOKUP, it's much better than a VLOOKUP.
[19]
And you are going to come across situations
or you've probably come already across situations
[24]
where VLOOKUP just wasn't working.
[27]
It couldn't do the lookup that you wanted,
because your lookup problem was too complex.
[34]
That's exactly when index and match can come
to the rescue.
[39]
It was difficult for me to start using index
and match.
[44]
Just like a habit, I had to force myself at
the beginning to use it until I got the hang
[51]
of it.
[52]
Now, what I'm going in this lecture is first,
to explain to you how index works in easy
[60]
terms.
[61]
And then I'm going to show you how match works.
[62]
And then we're going to put these together.
[64]
So, the example I have is list of divisions,
apps, revenue, and profits.
[71]
The aim of our formula is that we want someone
to select an app here, so let's say Misty
[78]
Wash and we want to get the division first.
[81]
So you can see that the order of these, apps
is here, division is here, right?
[87]
Would VLOOKUP work?
[89]
The classical VLOOKUP is not going to work,
right?
[92]
Because you will need to have apps on this
side and division on this side.
[97]
That's why index and match is great for this.
[100]
Let me show you what index does on its own,
alone.
[105]
The first argument in index is the array argument.
[110]
Think of it like this: INDEX is like a GPS.
For this GPS you need to upload a map
[118]
on there.
[119]
Your map is your array.
[122]
Okay, so if i highlight this, that's my map.
[127]
And what map do you give it?
[129]
Well, the only map it needs is the map that
has your answer in it.
[135]
It doesn't matter what your lookup problem
is, it doesn't matter in this case that we're
[142]
looking for an app and it's called Misty Wash,
I don't need to include that in my map.
[148]
I only need to include in the map where my
answer is.
[153]
If my answer was also going to be here or
here or here, I have to extend my map.
[158]
But in this case, I know that I wanted division.
[161]
And the division is somewhere here.
That's all I need to include.
[166]
Okay, the next argument is basically how many
rows do you need to go down, and how many
[174]
columns do you need to move across?
[176]
Think of it like the longitude and latitude
in a map.
[181]
And these arguments are numbers that you give
it.
[184]
If I say move down two rows.
[186]
I close the bracket, because the last argument,
you see it's in square brackets, it means
[192]
it's optional; it's not necessary.
[195]
And in this case anyway, I just have one column,
so I'm going to put two.
[199]
Okay, I get Game.
[201]
Why?
[202]
Well, I indexed what?
[204]
This area, right?
[206]
And it counts like this: This is a one, this
is a two.
[209]
If it returns the second place, and that's division.
[214]
Well, what happens now if I put one in there
and I close the bracket?
[223]
It's still Game.
[225]
It's one column, right?
[226]
If I put a zero, what happens?
[228]
It's still Game.
[229]
Excel realizes that it's one column.
[232]
But what happens if I put a two here?
[235]
Reference.
[236]
I'm moving outside my map.
[239]
Okay, if I was going to do that, if I really
think that my answer is actually somewhere
[245]
here, all I have to do is extend my
map.
[249]
Instead of A6 to A15, I'm going to look until
B15 and then it works.
[258]
That's all there is with index.
[262]
Now, the part that we want to automate ... Now,
obviously we're not going to input two and
[268]
ones as the numbers here.
[269]
The part that we want to automate is the two. It's this row number argument.
[277]
This is where you need a function that is
going to return a number to the index.
[283]
Which functions return numbers?
[286]
Let's think of a few.
[287]
You have the COUNT function, right?
[290]
You have COUNTA. You have the have the row, you have the column functions.
[294]
Sometimes you could use these as arguments
in the index function, but in most cases,
[300]
the function that works in harmony with INDEX, that you're going to need, is the MATCH function.
[306]
Let's just write here...
[309]
and see what match does on its own.
[314]
Match needs a lookup value.
[316]
What is looking for?
[318]
In this case, we're looking for Misty Wash.
[323]
And it needs to lookup array.
[325]
Where should it find this?
[328]
In this case, it's here.
[331]
One thing you need to watch out with the match
function is that it needs a one-way street.
[337]
You cannot give it something like this, because
then it doesn't know should it look this way
[342]
or should it look this way?
[344]
It has to be a one-way street.
[347]
Let's go back.
[350]
That's where it should find it.
[354]
And then the last argument is the match type.
[356]
Do you want an exact match, less than, or
greater than?
[359]
In most case, you're going to need an exact
match.
[362]
That's like the false argument in VLOOKUP.
[366]
If your data was sorted and you were looking
for an approximate match, then you're going
[370]
to need less than or greater than.
[372]
But, majority of the cases, it's going to
be zero.
[375]
What am I going to get?
[377]
Nine.
[378]
What does that mean?
[380]
That means that Misty Wash is the ninth position in here.
[386]
Is is the ninth position?
[387]
Yes, it is, right?
[390]
That's exactly the argument that we're going
to return to the index function.
[395]
Let's type this now, the full formula.
[399]
First, what comes in the index argument?
[403]
Where we think the answer is, right?
[404]
The map that contains the answer.
[407]
And that's that.
[409]
What is our row argument?
[410]
Well, we're going to use match to figure it
out for the index argument.
[415]
And we're going to match this one.
[418]
Where?
[419]
In here, and we're going to look for an exact
match.
[425]
Bracket close two times.
[427]
Now, the only important thing here is that
I have the same length, the same array length,
[436]
for both my index and the match functions,
because they need to be in sync, right?
[442]
And this gives me Utility.
[444]
Because if they're not, I'm going to be returning
the wrong address to the index function.
[451]
Now we're going to do the same thing for profit.
[455]
We're going to index.
[457]
What should I index right now?
[461]
This column, right?
[462]
That's all I need.
[464]
And how many rows should I move down?
[469]
I'm going to use the match function.
[471]
What am I looking up?
[472]
I'm looking up Misty Wash.
[474]
Where am I looking it up?
[476]
Well, only in here.
[478]
Okay, arrays have the same height.
[480]
And I'm looking for an exact match.
[483]
Bracket, close, close.
[485]
And that's my number.
[487]
That's a simple INDEX and MATCH, but what if I wanted
to switch between profit and revenue here?
[497]
Let's do something.
[499]
Let's add a validation to this.
[503]
I'm going to put data validation, list,
and I want these two.
[511]
Here what I want to do is to be able to switch
between revenue and profit, and this number
[517]
should obviously change.
[518]
How do I do that?
[523]
That's when I need to use the column argument,
right?
[527]
But, is that the only thing I need to add,
or do I need to update something in my original
[533]
map in my index?
[536]
I have to update my map, right?
[539]
Because my map now should also include the
revenue column, because my answer could be
[544]
somewhere here, could be somewhere here, depending
on what the user's going to select in the
[549]
dropdown.
[550]
First thing is to update the map.
[552]
The second thing is what about the row argument?
[555]
Is that okay?
[556]
It's fine, right?
[558]
Because I know I should move down this many
rows.
[561]
And then the next question I need to answer
is how many columns do I move?
[565]
Well, what does that depend on?
[568]
It depends on what the user has selected.
[572]
I'm going to match again, because I need a
number back, right?
[576]
I'm going to match again for this, that's
my lookup value.
[581]
Where am I looking this up?
[584]
In here.
[586]
And you see this range, the width of my lookup
array is the same as the width of my index.
[592]
I have to be in sync.
[595]
And then I'm going to get a perfect match,
close this.
[600]
I think that's it.
[602]
And click enter.
[603]
Now, what happens?
[605]
I go for revenue, I get revenue.
[607]
I change this to, let's go to Hackrr.
[614]
Hackrr is a game.
[616]
It has this much revenue.
[618]
And how much profit?
[620]
This much profit.
[625]
That's how you can use index and match for
matrix type of lookups.
[631]
What I suggest you do is that the next time you
come across a lookup issue, don't use VLOOKUP,
[639]
even if VLOOKUP will work there.
[641]
Try to use index and match, because that's
the only way that you're going to get practice.
[646]
And the more practice you get, what happens
is that then the moment that you get a more
[652]
complex lookup, let's say your colleague is
trying to do a VLOOKUP and it's not working
[656]
and they ask you, "Do you know how to solve
this?"
[659]
And you're going to be like, "Yes.
[661]
I'm going to use index and match here."
[664]
In the next example, I'm going to show you
how you can use it to solve more complex problems,
[670]
because in real life, you don't have your
data generally set up as simple as this.
[675]
You might have it set up like this where you
have more than one header.
[681]
And we're going to see in the next lecture
how to solve this.
[684]
I hope you enjoyed this lecture and don't
forget to subscribe to get notifications when
[688]
I put out more videos that are like this one.
Most Recent Videos:
You can go back to the homepage right here: Homepage





