Professional Documents
Culture Documents
EXCEL - How To Write Perfect VLOOKUP and INDEX and MATCH Formulas
EXCEL - How To Write Perfect VLOOKUP and INDEX and MATCH Formulas
EXCEL - How To Write Perfect VLOOKUP and INDEX and MATCH Formulas
John Franco is someone who I worked with very closely via online collaboration for the 1st
five months of 2010. He is not only a very advanced user and instructor of Excel
spreadsheets with a true gift for thinking like Excel thinks, but also possesses the highest
degree of true entrepreneurial mindsets and understanding that one might hope to
encounter. His Blue Ocean mindset along with a deep understanding and fervent/constant
application of universal laws and principles, have set John Franco on a path to earning a
place among the worlds greatest thinkers.
John cares deeply for and is genuinely committed to the advancement of peoples
effectiveness in their chosen careers as well as the world around them in general. His
sincerity towards humanity as a whole, and our advancement in both effectiveness and
happiness is what sets him apart from many in his field. Im honored to know him as well as
I do, and would not hesitate to work with him again in any capacity. John Franco is an
Excel expert of the highest level, an entrepreneur of great effectiveness, and a proven true
friend to mankind in all facets of his life.
Jeff Stewart, Dufur, Oregon. Partner and Chief Editor,
Excel Spreadsheet Authors (my first web site)
Dear John,
Its such a nice feeling that people like you are existing on this earth. Who are willing to
teach and share whatever they are good at. Teaching with no selfish reason is the best thing
considered in India. If you give money or some material thing it will not last forever. But if
you teach something to anyone it stays permanently with that person.
So John keep up the good work. God bless you. I will be definitely follow you.
John, Its such a nice feeling that I could follow you as a subscriber. Yes you have done it
and I feel proud about it. The feeling of giving is great and you have given knowledge to
people. I wish that I could learn and be like you. I will follow you in your private
Table of contents
TABLE OF CONTENTS
12
13
14
15
Elements of a table
15
16
16
17
17
18
18
18
20
20
20
21
22
HOW TO GET RID OF #N/A ERRORS ONCE FOR ALL WITH THE TIF TECHNOLOGY
23
23
24
26
So you need a list with names and phones. This list (phone directory) can be in
paper, in a cell phone, in a digital .pdf file, etc. And you need to find the exact
phone number and not everyone else's number (what to return)
10
What you don't know and are eager to know (Harrison Ford's phone
number)
In a moment you will learn that these 4 terms exist always in any lookup
formula...
Now we can redefine the lookup terms...
What you know = Search value
You have always a search value; you cannot look at a table without this value in
mind; it's pointless.
Where should it be = Source table
You need a reliable list of data. This table should contain a column with the
values you know and other columns with the values you don't know.
What you dont know and are eager to know = Column with the data you want
The source list should contain columns with the information you don't know
11
And you need a tool to search and find the value you know and then to pick the
unknown info at some adjacent attribute column. This tool can be your eyes,
your index finger, a pointer, etc.
In Excel you use a lookup formula as a pointer (VLOOKUP or MATCH).
,table_array,col_index_num,range_lookup)
12
13
14
The good news about computers is that they do what you tell them to do.
The bad news is that they do what you tell them to do.
Ted Nelson
ow you will learn the key principles to set up your data table so your
VLOOKUP/INDEX & MATCH formulas deliver answers instead of errors.
Let's start...
This is the row that identifies each column of data. The headers should be
unique so the data is managed without ambiguity, e.g. you can't have two
columns to store the "First name", you neither should store dates in the "City"
column. See the picture below
This row should also be in a different format so you don't include this one in
filtering, sorting, etc. Additionally, Excel detects such row and always asks you
15
This is the data that each column contains; the amount of rows per table
increases or decreases depending on the need of each Excel user.
On the other hand, an Excel table can only manage three types of data: 1)
Numbers, 2) Dates and 3) Texts.
Knowing these Excel data principles will help you enter data correctly in tables
and avoid non-matching problems and confusions.
Be careful to use the correct decimal delimiter, for example: if you type a
comma (12,34) when the decimal delimiter of your computer is set to be a
point (12.34), your number won't be interpreted as a number by Excel (will be
stored as text), and you will get unexpected results in Math operations like
sum, average, etc. and also when you try to match records.
16
First, avoid unnecessary mystification, forget the date format, and instead work
with Dates the same way you would do it with numbers.
Why?
this concept is very simple, see below:
The date 01/01/1900 is the number 1 (the minimum Date)
The date 02/01/1900 is the number 2
Excel Dates are Numbers so use Excel Dates conventionally as you would
do it with numbers; you can even perform the same operations:
subtracting, sorting, finding, calculating intervals, etc.
You can enter a date as a number (the serial number it represents). For
example the date 06/01/2011 is the number 40695, then you can format it as
a date
Enter dates using the right date format, e.g. just type the month, day and year
using the right sequence (MM/DD/YYYY). You can also use the (/) delimiter
A text is any character or text (a, c, r, hello, Susan, etc.); a text can also be any
alphanumeric character (HH-01, 1A, 2B, etc.)
How to enter texts?
A text does not contain quotes when is entered into an Excel cell
17
Why?
A non-left column is out of sight for the VLOOKUP function. See the picture
below
Why?
Approximate VLOOKUP and INDEX and MATCH need the index column to be
sorted ascending so you get sound results
Why ascending?
That's a good question!
18
Excel interprets the index column as a perfect line number (properly sorted)
and searches nearest or exact values from left to right. See the picture below
19
Extra spaces at the beginning or end of a cell affect filtering, sorting, searching
and matching. Instead of typing spaces, indent the text within the cell.
Another common mistake is adding units to cells, for example : 100 m2, 10
Ton, etc. See the picture below
Keep the same formatting for the entire column using the same font, colors,
dates/number format, etc.
Excel has a special capability called Extend data range formats and formulas.
When you add new data to the end of a list, Excel extends consistent formatting
and formulas. It extends the format when the three of the five preceding cells
use the same format.
20
In the US, the norm is using a dot (.) as a decimals delimiter. In some parts of
the world, the norm is using (,) as a decimals delimiter.
How do you set the decimal delimiter on your computer?
Go to: Start menu>Control Panel>Regional Settings>Regional
options>Customize Regional Options. See the picture below...
21
Now you can set up your tables the smart way! And you will get consistent
matches when using VLOOKUP/INDEX & MATCH formulas.
22
How to get rid of #N/A errors once for all with the TIF technology
ow you will learn the 3-step system (TIF technology) for diagnosing and
preventing #N/A errors when using VLOOKUP/INDEX & MATCH formulas.
First, you need to change the way you interpret Excel errors because...
in this box
23
To sound great with your music instrument you need to have everything always right
(no exception):
24
How to get rid of #N/A errors once for all with the TIF technology
The player
So if you are a great player but have the wrong notes, you will fail; at the same time,
if you are a great player and have the right notes but your instrument is not properly
tuned, you will fail too; finally, if you have the instrument tuned, the right notes but
you are not trained to play the guitar, you will fail also. The same happens with
lookup formulas, if you want to succeed with them you need to have these three
elements always right (no exception):
In summary, a lookup formula is 3-part system so to get a perfect match you need to
have the 3 elements in place: the data table, the index column and the lookup
formula (VLOOKUP/INDEX and MATCH). So you have been introduced to the TIF
approach. The term TIF stands for: Table, Index column and Formula.
Now
25
You cannot get rid of #N/A messages; you can only be sure your values match or
differ. And to be that certain you should follow a 3-step systematic approach (TIF
technology).
You can first think that the VLOOKUP is wrong so you are prone to check it, or maybe
you are prone to think the source data is the problem or maybe you think you the
index column is wrong, anyway you need to check them all. You will suffer a lot if
you don't have a systematic approach.
Now you will systematically diagnose the problem by following the TIF technology...
You perform several checks on each element: Table, Index column and the formula.
26
How to get rid of #N/A errors once for all with the TIF technology
After checking each element of this example you find that the problem is spaces on
your index column, see below...
27
Here's a formula you can use to remove spaces from your cells
28
How to get rid of #N/A errors once for all with the TIF technology
In summary...
Replace spaces with this formula: =SUBSTITUTE(A2," ","")
And then replace NBSP (non breaking spaces) with this formula:
=SUBSTITUTE(A2,CHAR(160),"")
You can do both (replacing spaces and NBSP (non breaking spaces) ) using this
formula...
: =SUBSTITUTE(SUBSTITUTE(A2,CHAR(160),"")," ","")
Edit cells in column A to see the formula in action (Use the practice file "removingundesired-characters.xls")
Now you can use VLOOKUP/INDEX & MATCH formulas to work with big tables
because you will not get unexpected #N/A errors, and when you get them you will
know exactly where the problems are.
Thats all for now!
29