Table of Contents
1. Excel VLOOKUP Function
An Overview
2. VLOOKUP Example 1
Finding Brad's Math Score
3. VLOOKUP Example 2
Two-Way Lookup
4. VLOOKUP Example 3
Using Drop Down Lists as Lookup Values
5. VLOOKUP Example 4
Three-way Lookup
6. VLOOKUP Example 5
Getting the Last Value from a List using the Excel VLOOKUP
Function
7. VLOOKUP Example 6
Partial Lookup using Wildcard Characters and VLOOKUP
function10.
M1.
12.
VLOOKUP Example 7
VLOOKUP Returning an Error Despite a Match in Lookup Value
VLOOKUP Example 8
Case Sensitive Lookup using the VLOOKUP Function
VLOOKUP Example 9
Using VLOOKUP with Multiple Criteria
VLOOKUP Example 10
Handling Errors while Using the Excel VLOOKUP Function
Can't Miss Excel ResourcesExcel VLOOKUP Function
EURO Ia (aw
VLOOKUP()
What it Does:
Looks for a given value in a vertical list, and once it
has spotted that value, it would use that row and
return the value from the specified column number
Syntax:
=VLOOKUP(lookup_value, table_array,
col_index_num, [range_lookup])
Prrumpexcel.com
Excel VLOOKUP Function
Excel VLOOKUP function is THE benchmark. You know something in
Excel if you know how to use the VLOOKUP function. If you don't, you
better not list Excel as one of your strong areas in your resume.
I have been a part of the panel interviews where as soon as the
candidate mentioned Excel as his area of expertise, the first thing
asked was - you got it - the VLOOKUP function.Now that we know how important this Excel function is, it makes
sense to ace it completely to be able to proudly say - "I know a thing or
two in Excel".
In this brief guide, I'll cover everything there is to know about the
VLOOKUP function, and then show the power if it by using examples.
So buckle up. It's time for the takeoff.
When to use the Excel VLOOKUP Function
Excel VLOOKUP function is best suited for situations when you are
looking for a matching data point in a column, and when the matching
data point is found, you go to the right in that row and fetch a value
from a cell which is a specified number of columns to the right.
Let's take a simple example here to understand when to use the Excel
VLOOKUP function.
Remember when the exam score list was out and pasted on the notice
board and everyone used to go crazy finding their names and their
score (at least that's what used to happen when | was in school).
Here is how it worked:
* You go up to the notice board and start looking for your name or
enrolment number (running your finger from top to bottom in the
list).
« As soon as you spot your name, you move your eyes to the right of
the name/enrolment number to see your scores.
And that is exactly what VLOOKUP function does for you (feel free to
use this example in your next interview).
VLOOKUP function looks for a specified value in a column (in the above
example, it was your name) and when it finds the specified match, itreturns a value in the same row (the marks you obtained).
Syntax
=VLOOKUP (lookup value, table array,
col_index_num, [range_lookup])
Input Arguments
« lookup_value — this is the look-up value you are trying to find in the
left-most column of a table. It could be a value, a cell reference, or a
text string. In the score sheet example, this would be your name.
table_array — this is the table in which you are looking for the value.
This could be a reference to a range of cells or a named range. In the
score sheet example, this would be the entire table that contains
score for everyone for every subject
col_index — this is the column number from which you want to
fetch the matching value. In the score sheet example, if you want
the scores for Math (which is the first column in a table that
contains the scores), you'd look in column 1. If you want the scores
for Physics, you'd look in column 2.
[range_lookup] — here you specify whether you want an exact
match or an approximate match. If omitted, it defaults to TRUE —
approximate match (see additional notes below).
Additional Notes (Boring, but important to know)
« The match could be exact (FALSE or 0 in range_lookup) or
approximate (TRUE or 1).
« In approximate lookup, make sure that the list is sorted in
ascending order (top to bottom), or else the result could be
inaccurate.
« When range_lookup is TRUE (approximate lookup) and data is
sorted in ascending order:
© If the VLOOKUP function can not find the value, it returns thelargest value, which is less than the lookup_value.
© Itreturns a #N/A error if the lookup_value is smaller than the
smallest value.
© If lookup_value is text, wildcard characters can be used (refer to
the example below).
Now, hoping that you have a basic understanding of what VLOOKUP
function can do, let's peel this onion and see some practical examples
of the VLOOKUP function.VLOOKUP Example 1
Finding Brad's Math Score
Finding Brad's Math Score
In the example below, I have a list wth student names in the left-most
column and marks in different subjects in column B to E.
A B C D E
1 Subject
2 Name Math | Physics | Chemistry] Biology
3 38 58. 66 49
4 88 92 74 30
5 57 a 91 st
6 82 56 45 35
7 55 55 65 75
8 Maris AA 6o 380 90,
9 Sil 75 51 37 84
10 Josh 38 37 51 56
Now let's get to work and use the VLOOKUP function for what it does
best. From the above data, | need to know how much Brad scored in
Math.
Here is the VLOOKUP formula that will return Brad's Math score:
=VLOOKUP ("Brad", $A$3:5E$10, 2,0)
The above formula has four arguments:
"Brad": - this is the lookup value.
¢ SAS3:SFSIO - this is the range of cells in which we are looking.
Remember that Excel looks for the lookup value in the left mostcolumn. In this example, it would look for the name Brad in A3:A10
(which is the left-most column of the specified array).
* 2- Once the function spots Brad's name, it will go to the second
column of the array, and return the value in the same row as that of
Brad. The value 2 here indicated that we are looking for the score
from the second column of the specified array.
* 0 - this tells the VLOOKUP function to only look for exact matches.
Here is how the VLOOKUP function works in the above example.
First, it looks for the value Brad in the left most column. It goes from
top to bottom and finds the value in cell A6.
A 8 c D E
1 I Subje
2 |Name | Math | Physics | Chemistry | Biology
3 Matty 38 58 6649
4 [Bob | 88 92 74 30
5 Tom [sz | 7 1 91
G [Beat | oz 5G 45 85
7 Denny | 55 55 65 75
8 Maia 44 cy 80 90
9 Gil [7s SL. 57 B84
10 [Josh | 38 37 51 56
As soon as it finds the value, it goes to the right in the second column,
and fetches the value in it.
Boowoanenn
You can use the same formula construct to get anyone's marks in any
of the subjects.For example, to find Maria's marks in Chemistry, use the following
formula:
=VLOOKUP ("Maria", $A$3:$E$10,4,0)
1 Subject
2 Name Math | Physics | Chemistry | Biology
3 Matt 38. 58 66 49
4 Bob | | 88 | 92 74 90
5 Tom 57 7 1 91
6 Brad | | 82 56 45 95
7 Jenny| 55, 35, Bx 75
8 Maria ey) 30
9 Sil 75 51 84
10 Josh 38 37 51 56
In the above example, the lookup value (student's name) is entered in
double quotes. You can also use a cell reference that contains the
lookup value.
The benefit of using a cell reference is that it makes the formula
dynamic.
For example, if you have a cell with a student's name, and you are
fetching the score for Math, the result would automatically update
when you change the student's name.
For example, in the example below, if | change the name from Brad to
Jill, the result in G4 would automatically update and return 75 (which is
Jill's score in Math).aa
A B ie D
1 Subject
2 Name Math | Physics | Chemistry
3 Matt 38 38 66
4 Bob 88 92 74
5 Tom 57 | 77 OL
6 Bred 82 “36 a5
7 Jenny 5s 55 65
Maria 44 ao RO
9 Gill 75 St 57 84
10 Josh 387 SL 56
Click here to see a live demo of how this works.
If you enter a lookup value that is not found in the left-most column, it
returns a #N/A error.VLOOKUP Example 2
Two-Way Lookup
Two-Way Lookup Using the VLOOKUP
Function
In Example 1, we hard-coded the column value. Hence, the formula
would always return the score for Math as we have used 2 as the
column number.
But what if you want to make both the VLOOKUP value and the
column number dynamic.
For example, in the example below, a two-way lookup means that you
can change the name of the student as well as the name of the subject
and it will fetch the correct score from the table
o ~ fe || Brad
A 5 c D EF aes H
: a
2 [Name | Math | Physics | Chemistry | Biology
3 Matt 38 58 66 49 Math
4)[pob a8 3 74 90 (Brad a2
5 it [57 77 91 OL
6 Brad | 82 56 45 95
7 Denny | 55 | 55 65 75
8 Mara | 44 69 80 90
° 7 StS. 84
10 38 a? ot 36
Click here to see the live demo.To make this two-way lookup formula, you need to make the column
dynamic as well. So when a user changes the subject, the formula
automatically picks the correct column (2 in the case of Math, 3 in the
case of Physics, as so on..).
To do this, you need to use the MATCH function as the column.
argument. Here is the formula that will do this:
=VLOOKUP (G4, $A$3:$E$10,MATCH
H3,$A$2:S$E$2,0),0)
The above formula uses MATCH(H3,$A$2:SE$2,0) as the column.
number.
MATCH function takes the subject name as the lookup value (in H3)
and returns its position in A2:E2. Hence, if you use Math, it would
return 2 as Math is found in B2 (which is the second cell in the specified
array range).
Want to learn more about MATCH Function - click here for a tutorial
with examples and video.VLOOKUP Example 3
Using Drop Down Lists as Lookup Values
Using Drop Down Lists as Lookup Values
In the above examples, we had to manually enter the data. That could
be time-consuming and error-prone, especially if you have a huge list
of lookup values.
A good idea in such cases is to create a drop down list of the lookup
values (in this case, it could be student names and subjects) and then
simply choose from the list. Based on the selection, the formula would
automatically update the result.
Something as shown below:
A 8 F [6 H
1
2 Name Math
3 Matt 38 58 66 49 Math
4 [Bob 88 92 74 30 Bob |
5 Tom 57 7 ot 31 [vate
6 [Brad 82 56 45 5 |S
7 Jenny. 55 55 65 3
& Maria aa 69 80 80 [Jenny
9 il 75 51 57 e4 [Mane
10 [Josh 38 37 51 56 [Jesh
This makes a good dashboard component as you can have a huge data
set with hundreds of students at the back end, but the end user (let's
say a teacher) can quickly get the marks of a student in a subject by
simply making the selections from the drop down.How to make this:
The formula used in this case is the same used in Example 2.
=VLOOKUP (G4, $A$3:$E$10,MATCH (H3, $A$2:SE$2,0),0) T
he lookup values have been converted into drop-down lists.
Here are the steps to create the drop down list:
Select the cell in which you want the drop-down list. In this
example, in G4, we want the student names.
Go to Data --> Data Tools --> Data Validation.
In the Data Validation Dialogue box, within the settings tab, select
List from the Allow drop-down.
In the source, select $4$3:SA$10
Click OK.
Now you'll have the drop-down list in cell G4. Similarly, you can create
one in H3 for the subjects.VLOOKUP Example 4
Three-way Lookup
Three-way Lookup using the VLOOKUP
Function
What is a three-way lookup?
In Example 2, we've used one table with scores for students in
different subjects. This is an example of a two-way lookup as we use
two variables to fetch the score (student's name and the subject's
name).
Now, suppose in a year, a student has three different levels of exams,
Unit Test, Midterm, and Final Examination (that's what | had when |
was a student).
A three-way lookup would be the ability to get a student's marks for a
specified subject from the specified level of exam.
Something as shown below:A 8 ° c ori6 4
1 UNTT TEST - Subject |
2 [Name | Math | Physics [Chemistry] Giology Unit Test
3 Met 38 ese a rm
2 [eb mete oe 4 Gece
= tom S79
¢ pal | seas as
fells Le te te
ty
s
io ama
it watt
13 (Name
19 [Matt
20 (Bob
21 [Tom
22 [Brad
23 [Jenny
In the above example, the VLOOKUP function can lookup in three
different tables (Unit Test, Midterm and Final Exam) and returns the
score for the specified student in the specified subject.
Here is the formula used in cell H4:
=VLOOKUP (G4, CHOOSE (IF (H2="Unit
Test",1,1F (H2="Midterm", 2,3)) , $A$3:$E$7, $A$11:$E$
15, $A$19:$E$23) , MATCH (H3, $A$2:$E$2,0) ,0)
This formula uses the CHOOSE function to make sure the correct table
is referred to.
Let's analyze the CHOOSE part of the formula:
CHOOSE (IF (H2="Unit
Test",1,IF(H2="Midterm",2,3)),$A$3:S$E$7,$A$11:SE$
15,$A$19:SE$23)
The first argument of the formula is IF(H2="Unit
Test",1,IF(H2="Midterm",2,3)), which checks the cell H2 and see whatVLOOKUP Example 5
Getting the Last Value from a List using the Excel VLOOKUP.
Function
Getting the Last Value from a List using the
Excel VLOOKUP Function
You can use Excel VLOOKUP function to get the last numerical value
from alist.
The largest positive number that you can use in Excel is
9.99999999999999E +307. This also means that the largest lookup
number in the VLOOKUP number is also the same.
I don’t think you would ever need any calculation involving such a
large number. And that is exactly what we can use get the last number
ina list.
Suppose you have a dataset (in A7-A4)as shown below and you want
to get the last number in the list.EST)
Here is the formula you can use:
LOOKUP (9.99999999999999E+307, $A$1:$A$14, TRUE)
Note that the formula above uses an approximate match VLOOKUP
(notice TRUE at the end of the formula, instead of FALSE or 0).
Also, note that the list doesn't need to be sorted for this formula to
work.
Here is how the approximate VLOOKUP function works. It scans the
left most column from top to bottom.
« Ifit finds an exact match, it returns that value.
« If it finds a value that is higher than the lookup value, it returns the
value in the cell above it.
« If the lookup value is greater than all the values in the list, it returns
the last value.
In the above example, the third scenario is at work.
Since 9.99999999999999E +307 is the largest number that can be used
in Excel, when this is used as the lookup value, it returns the last
number from the list.
In the same way, you can also use it to return the last text item from
the list. Here is the formula that can do that:=VLOOKUP ("zzz", $A$1:$A$8,1, TRUE)
The same logic follows. Excel looks through all the names, and since
2zz is consider bigger than any name/text starting with alphabets
before zzz, it would return the last item from the list.VLOOKUP Example 6
Partial Lookup using Wildcard Characters and VLOOKUP
functio
Partial Lookup using Wildcard Characters
and VLOOKUP function
Wildcard characters are awesome. It's that magic potion that gives
your formulas super powers.
Partial look-up is needed when you have to look for a value ina list
and there isn’t an exact match.
For example, suppose you have a data set as shown below, and you
want to look for the company ABC in a list, but the list has ABC Ltd
instead of ABC.
lavansune
|Family Dollar Stores
You can not use ABC as the lookup value as there is no exact match in
column A. Approximate match also leads to erroneous results and it
requires the list to be sorted in an ascending order.
However, you can use a wildcard character within the VLOOKUP
function to get the matchEnter the following formula in cell D2 and drag it to the other cells:
=VLOOKUP ("*"&C2&"*", SAS2:S$AS$8,1, FALSE)
D2 . fe | =seookurc’*"acza"", $082: $488, 1, FALSE)
A 8 D je F
3 |Company aca apr incacoe|
2 [asc Led. ‘ABC IASC Lt
2 [Walmart Reta Homa "The Home Dapot
4 The Home Depot amazon ‘amiazon.com
5 [CVS Caremark Dollar Family Dollar Steres
© amazon.com
7 ‘Apple Stores
& Famiy Dollar Stores
How does this formula work?
In the above formula, instead of using the lookup value as is, it is
flanked on both sides with the wildcard character asterisk (*) —
oR CIEE!
An asterisk is a wildcard character in Excel and can represent any
number of characters.
Using the asterisk on both sides of the lookup value tells Excel that it
needs to look for any text that contains the word in C2. It could have
any number of characters before or after the text in C2.
For example, cell C2 has ABC, so the VLOOKUP function looks through
the names in A2:A8 and searches for ABC. It finds a match in cell A2, as
it contains ABC in ABC Ltd. It doesn't matter if there are any characters
to the left or right of ABC. Until there is ABC in a text string, it will be
considered a match.
Note: VLOOKUP function always returns the first matching value and
stops looking further. So if you have ABCLtd., and ABC Corporation in a
list, it will return the first one and ignore the rest.VLOOKUP Example 7
VLOOKUP Returning an Error Despite a Match in Lookup
Value
VLOOKUP Returning an Error Despite a
Match in Lookup Value
It can drive you crazy when you see that there is a matching lookup
value and the VLOOKUP function is returning an error.
For example, in the below case, there is a match (Matt), but the
VLOOKUP function still returns an error.
2 : || Facoonue cate gng2:5a99 1,0)
5 ie > E = 6 H
| =a]
het
Now while we can see there is a match, what we can not see witha
naked eye is that there could be leading or trailing spaces. If you have
these additional spaces before, after, or in between the lookup values,
it ISN'T an exact match.
This is often the case when you import data from a database or get it
from someone else. These leading/trailing spaces have a tendency tosneak in.
The solution here is the TRIM function. It removes any leading or
trailing spaces or extra spaces between words.
Here is the formula that'll give you the right result.
=VLOOKUP ("Matt", TRIM(SA$2:$A$9) ,1,0)
Since this is an array formula, use Control + Shift + Enter instead of just
Enter.
Another way could be to first treat your lookup array with the TRIM
function to make sure all the additional spaces are gone, and then use
the VLOOKUP function as usual.VLOOKUP Example 8
(Tease om Morel ce RUC TeM UNA O18) Olam Ne ten)
Case Sensitive Lookup using the VLOOKUP
Function
By default, the lookup value in the VLOOKUP function is not case
sensitive. For example, if your lookup value is MATT, matt, or Matt, it's
all the same for the VLOOKUP function. It'll return the first matching
value irrespective of the case.
But if you want to do a case-sensitive lookup, you need to use the
EXACT function along with the VLOOKUP function.
Here is an example:
A cD E FE
1 Name Math
2 Matt 38 Matt 38
3 Bob 88 MATT 57|
4 MATT 57 matt 82
5 matt 82
© Jenny 55
7 Mana 44
8 Oil 75
9 Josh 38
As you can see, there are three cells with the same name (in A2, A4,
and AS) but with a different alphabet case. On the right, we have the
three names (Matt, MATT, and matt) along with their scores in Math.
Now the VLOOKUP function is not equipped to handle case-sensitivelookup values. In this above example, it would always return 38, which
is the score for Matt in A2.
To make it case sensitive, we need to use a helper column (as shown
below):
A D E f
Name —
Matt Matt 38|
Bob MATT 57
MATT matt 82
wanNankune
Fe
ES
To get the values in the helper column, use the =ROW() function. It will
simply get the row number in the cell.
Once you have the helper column, here is the formula that will give
the case-sensitive lookup result.
=VLOOKUP (MAX (EXACT (E2, $A$2: $A$9) *
(ROW (SA$2:$A$9))),$BS2:$C$9,2,0)
Now let's break down and understand what this does:
« EXACT(E2,SA$2:SA$9) - This part would compare the lookup value in
E2 with all the values in A2:A9. It returns an array of TRUES/FALSEs
where TRUE is returned where there is an exact match. In this case,
it would return the following array:
TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE.
EXACT(E2,SA$2:$A$9)*(ROW($AS2:$A$9) - This part multiplies the
array of TRUEs/FALSEs with the row number. Wherever there is a
TRUE, it gives the row number, else it gives 0. In this case, it would
return 2;0;0;0;0;0;0;0.
MAX(EXACT(E2,$A$2:SA$9)*(ROW(SA$2:$A$9))) - This part returns
the maximum value from the array of numbers. In this case, itwould return 2 (which is the row number where there is an exact
match).
« Now we simply use this number as the lookup value and use the
lookup array as B2:C9
Note: Since this is an array formula, use Control + Shift + Enter instead
of just enter.VLOOKUP Example 9
Using VLOOKUP with Multiple Criteria
Using VLOOKUP with Multiple Criteria
Excel VLOOKUP function, in its basic form, can look for one lookup
value and return the corresponding value from the specified row. But
often there is a need to use VLOOKUP with multiple criteria.
Suppose you have a data with students name, exam type, and the
Math score (as shown below):
E F 6 H
Unit Test | Mid Term | Final_
Matt
Bob
Jenny
Maria
“ill
‘Josh
at
az
13
14
415
16
17
18
19
Using the VLOOKUP function to get the Math score for each student
for respective exam levels could be a challenge.For example, if you try using VLOOKUP with Matt as the lookup value,
it'll always return 91, which is the score for the first occurrence of Matt
in the list. To get the score for Matt for each exam type (Unit Test, Mid
Term and Final), you need to create a unique lookup value.
This can be done using the helper column. The first step is to insert a
helper column to the left of the scores.
A B c D FE G H I
1 Name Exam | Helper | Math
2 (Matt |Unit Test 1 Unit Test| Mid Teom| Final
3 Bob Unit Test 52 Matt
4 Jenny Unit Test | 44 Dob
5 (Maria | Unit Test i) Jenny
6 ill ‘Unit Test [Fave Maria
7 (Josh | Unit Test 87 (al
8 Matt [Mid Term [53 Uosh
9 [Bob Mid Term 67
10 Jenny | Mid Term 45
11 (Maria | Mid Term | 84
12 [Sil Mid Term (87
413 Josh___| Mid Tern 7
14 [Mate Final a7,
15 (Bob Final 53
416 Jenny Final 75,
17 (Maria Final 78
18 Sil Final 41
19 (Tosh Final 56
Now, to create a unique qualifier for each instance of the name, use
the following formula in C2: =A2&"|"&B2
Copy this formula to all the cells in the helper column. This will create
unique lookup values for each instance of a name (as shown below):a B c D>
1 Name: Exam | __Helper Math
2 Matt [Unit Test | Matt|Unit Test | __ 91
3 Bod [Unt Test sobjunt Test | 52
4 Jenny [Unit Test Jenry|Unt Test| 44
5 Maria _|Unit Test Marialunit Test| 78
6 ail [Unt Test) Jillurit Test | __77
7 Josh [Unit Test Josh|Unit Test | _87
8 Matt Mid Term Matt[Mid Term | 53
© Rob | Mid Term) Ach|Mid Term | 67
10 Jenny [Mid Term |Jeany|Mid Term| 45
11 Mafia [Wid Term | Mariela Term | Be
12 Si Wid Term Jill Mid Term | 67
13 Josh | id Term | Josh| id Term | _77.
14 Matt | Final | Matt|Final_| 67
15. Bob Final Bob|Final 53
16 Jenny Final_|Jenny|Final_| 75
17 Matia Final Maria|Final_| 78
10 i Final_|__iillFinal aa
19, Josh Final | _Josh|Final 56
Now, while there were repetitions of the names, there is no repetition
when the name is combined with the level of examination.
This makes it easy as now you can use the helper column values as the
lookup values.
Here is the formula that'll give you the result in G3:18.
=VLOOKUP ($F3&"|"&G$2,$C$2:$D$19,2,0)
Here we have combined the student name and the level of
examination to get the lookup value, and we use this lookup value and
checks it in the helper column to get the matching record.a oa &
oe) é Dec Fr om ou 1
1 [Mame | Exam | Heber | Math
2 [Matt [Unit Test | Matt|Unt Test | 91 Unit Test [wid Tem [Final
3) [sob [Unit Test| Bob iunit Test | 52 | Mate 3 33
4 Denny [Unit Test [JennylUnt Test| 44 | [G00 EI 67
5 Mana | Unit Test | Maria|Unit Test | 78. Jenny. 4 aS
5 Gi Unit Test | Jijunit Test [77 | [Mari 7 a4)
7 josh |unit Test| Joshjunit rest | e7 | a 7 7
@ [Mate [Mid Term | mate|oid Tom | 62 | Joat 3 7
9 gob | MidTerm| gob|Mid Term | 67
10 Jenny [Mid Term |Jenny) Mid Term] 45
31. Maria | Md Term | Maria [Mid Term | 84
12 Mid Term| il|Md Term [87
43 Josh [Mid Term | Josh|pad Term | 77
14 Matt Final MattlFinal | 67
45 [Bob Finel_|~ BoblFinal | 53
46 Jenn Final_|JennyiFinal | 75
47 Maria Final_[MerialFinal|__78
18 Final | il Final at
39 Dosh Final_| Josh |Final | 56
Note: In the above example, we have used | as the separator while
joining text in the helper column. In some exceptionally rare (but
Possible) conditions, you may have two criteria that are different but
ends up giving the same result when combined. Here is an example:
A 8 D
1 (Criteria 1 |Criteria 2 1 |With Separator
2 laa aye. Se aa |axyz
3 Jaga yz aaa [xyz
4 bb bxyz [bb|bxyz
5 [bbb xyz [bbb |xyz
Note that while A2 and A3 are different and B2 and B3 are different,
the combinations end up being the same. But if you use a separator,
then even the combination would be different (D2 and D3).
Here is a detailed tutorial on how to use VLOOKUP with multiple
criteria without using helper columns.VLOOKUP Example 10
Handling Errors while Using the Excel VLOOKUP Function
Handling Errors while Using the Excel
VLOOKUP Function
Excel VLOOKUP function returns an error when it can not find the
specified lookup value. You may not want the ugly error value
disturbing the aesthetics of your data in case VLOOKUP can't find a
value.
You can easily remove the error values with any meaning full text such
as "Not Available" or "Not Found".
For example, in the example below, when you try to find the score of
Brad in the list, it returns an error as Brad's name is not there in the
list.
D3 ~ & =VLOOKUP(02,5A$2:38$7,2,0)
A | =§6 cp pe)
1 [Name Score
2 (Matt o1 Brad
3 [Bob 52 [6 [_#n/a
4 Jenny 44
5 Mario 70
6 [sill 77
7 Josh 87
To remove this error and replace it with something meaningful, wrap
your VLOOKUP function within the IFERROR function.Here is the formula:
=IFERROR (VLOOKUP (D2, $A$2:$B$7,2,0) , "Not
Found")
The IFERROR function checks if the value returned by the first
argument (which is the VLOOKUP function in this case) is an error or
not. If it's not an error, it returns the value by the VLOOKUP function,
else it returns Not Found.
D3 =]: Ai | =IFERROR(VLOOKUP(02,$452:$087,2,0),"Not Found")
A Bc E F S F
1 |Name Score
2 Matt o1 Brad
3 [Bob 52 Not Found]
4 Jenny 44
5 (Maria 78
6 ill 77
7 |Josh 87
IFERROR function is available from Excel 2007 onwards. If you are
using versions prior to that, use the following function:
=IF (ISERROR (VLOOKUP (D2, $A$2:$B$7,2,0)),"Not
Found", VLOOKUP (D2, $A$2:$B$7,2,0))
Note: ve tried my best to proof read this guide, but in case you find any errors or spelling
mistakes, please let me know at
[email protected]
Warning: This isa free guide and you're allowed to share it with anyone who
needs it. You are NOT allowed to sellit or use it for any commercial purposes.Can't Miss Excel
Resources
Here are some Excel Resources that will skyrocket your Excel learning
and save a lot of time.
+ Excel Functions (Examples + Videos)
« FREE Excel Templates
« Excel Keyboard Shortcuts
« Excel Charting Tips
Excel Dashboards Nuts & Bolts
Online Excel Dashboard Course