Lookup Exercises
Lookup Exercises
Employee ID Location
55879
50217
50695
Name Salary
Ian Nash
Johnny Slash
Estelle Cormack
Salary Age
13836 25
11771 32
13046 35
18276 32
19327 26
18996 35
10387 25
12566 37
16406 42
15784 43
10959 30
14562 32
Below is a list of the employees who work in your company:
lookup_valueWhat we are looking for – this could be a text, number, or a single cell reference
table_array The range in which we will lookup for our value and its corresponding result. Please note that the ra
col_index_n What is the column number from which we want to return the result? The number should be relati
[range_lookuWhich range lookup method should be used. 0 is the default, so you should always type 0 (or FALSE
1 stands for “Approximate match”, and it should not be used on most cases so we’ll skip it for now.
table_array $B$3:$F$15 Our table array in this example is $B$3:$F$15. The $ signs indicate that B3:F15 is an ab
we will not have a problem as the lookup range will stay the same.
Please note that although this example doesn’t require that we use absolute referenc
col_index_n 2 This is the column number which represents the column from which we retreive our r
[range_looku 0 0 means EXACT match - Return my result based on exact match only. We will use 0 in
Employee ID Location
55879 Capetown Location
50217 Warsaw Capetown
50695 Cairo Warsaw
Answer This example is pretty much the same as previous ones, except for the fact that here we dynamically referenced
This example demonstrates why it is so important to use the absolute references in the table_array argument - $
Name Salary
Ian Nash 18276 Salary
Johnny Slash #N/A 18276
Estelle Corma 10959 #N/A
ell reference
g result. Please note that the range must start from the column which contains the value, and should contain the column in which we hav
t? The number should be relative to the first column in the selected range in table_array.
should always type 0 (or FALSE), which means “Exact Match” – Go to the exact match to the value I’m looking for.
st cases so we’ll skip it for now.
ease note that if the value was text, for example - a name, we would have to use quotation marks around the text.
ns indicate that B3:F15 is an absolute reference. This means that if we plan to copy or drag down our formula in the future to additional c
y the same.
that we use absolute references, it's recommended to use there $ signs anyway. They usually do no harm when used, but if we forget the
n from which we retreive our result - In this case, the name. Why 2? As the Name column is the second column in our table array. Remem
ct match only. We will use 0 in this argument 99% of the time.
hen we type it into the formula, otherwise the formula won't work.
d not column B, as we did in previous example. The reason for that is due the way VLOOKUP works - It looks up the value in the first colum
a won't work.
ere we dynamically referenced the employee ID cells, instead of manually typing 55879, 50217 and so on…
n the table_array argument - $B$3:$F$15. Thanks to the absolute references, we can type the formula only once, then drag it - and it will
P returns #N/A when it doesn't find a match - and this is exactly what happened here.
in the column in which we have our result.
when used, but if we forget them - we might make a mistake if we drag down our formulas.
umn in our table array. Remember - the number is relative to the first column of the table!
s up the value in the first column of the table.
Excel-Practice-Online.com
Name: Jack Checking Tool:
Age <- Insert formula here
Solution
The formula used here is: 16
Name: Dina
Favorite Color: <- Insert formula here
Solution
Name: Dina
Favorite Color: Yellow
Method #1:
Yellow Yellow
Here we keep "not found" and "match mode" empty.
Method #2:
Yellow Yellow
Here we use "not found" message in our if_not_found argument
Method #3:
Yellow Yellow
Using match mode 0 means using exact match (default behavior)
Return all car details for the car with Plate Number 5544667
In this example, we ask to look for the License Plate in cell B75,
Then we ask to lookup the value in range C69:C73.
Finally, we can return all the relevant data for this car by
higlighting range A69:E73, so Excel will return all the row if matched!
This magic happens using Excel Dynamic Arrays,
which allows returning multiple values!
#Exercise 4– Horizontal Lookup
Quarter Q1 Q2 Q3 Q4
Revenue 174,310 139,722 154,988 181,816
Cost of sales 112,921 112,466 113,796 101,873
Gross Profit 61,389 27,256 41,192 79,943
Gross Profit
Return the stock price for the day before and after January 4th 2020.
Date 4/1/2020
Solution:
To use approximate match, we can type -1 or 1 in match_mode argument.
-1 will return next smallest match (January 3rd)
1 will return next largest match (January 5th).
HLOOKUP
=HLOOKUP(looku
Sample Data
ID Number 15335 57564 73546 66475 54746
Name Yoav Danny Guy Rafi Lev
Age 40 50 61 23 30
ID Number 57564
Age 50 Input Excel function in yellow cell.
value in a table or a range by matching it with data in a row. HLOOKUP is very similar to ve
OOKUP searches vertically in columns, HLOOKUP searches horizontally in rows.
a is organized horizontally, with the lookup values in the first row and the corresponding da
Syntax
p])