The Data Matching Problem
You have two spreadsheets. Sheet 1 contains a list of 500 Employee ID numbers and their names. Sheet 2 contains a list of those exact same 500 Employee ID numbers, but it lists their current salaries instead of their names. Your boss asks you to combine them, creating a single report that shows the Employee Name next to their Salary.
If you try to do this manually, you will spend five hours copying an ID number, switching tabs, pressing CTRL+F to find the matching ID, copying the salary, switching tabs again, and pasting it. It is soul-crushing, error-prone work.
For over twenty years, the standard solution to this exact problem has been a function called VLOOKUP (Vertical Lookup). While Microsoft recently introduced a modern replacement called XLOOKUP, millions of corporate databases and older versions of Excel still rely exclusively on VLOOKUP. If you work in an office, understanding how to write a VLOOKUP formula is a mandatory survival skill.
The Anatomy of VLOOKUP
VLOOKUP acts exactly like a phone book. You know someone’s name (the lookup value), you flip to the right page (the table array), you look across the row to find their phone number (the column index), and you demand an exact match.
The formula requires four specific pieces of information, separated by commas:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
Let’s break down exactly how to write it using our Employee ID scenario. Imagine you are typing this formula into Cell C2 on Sheet 1 (right next to the Employee Name), and you want to pull the salary data from Sheet 2.
Writing the Formula Step-by-Step
- lookup_value: What is the piece of data you already have that exists on both sheets? In our case, it is the Employee ID sitting in Cell A2.
Type:=VLOOKUP(A2, - table_array: Where is the master list of data that you want to search through? You need to highlight the data on Sheet 2. Crucial rule for VLOOKUP: The common data (the Employee ID) MUST be in the very first, leftmost column of the area you highlight. Let’s say the data on Sheet 2 spans from Column A to Column D.
Add to your formula:Sheet2!$A$2:$D$500,(Use the $ signs to lock the range so it doesn’t break when you copy the formula down). - col_index_num: Once VLOOKUP finds the matching Employee ID in the first column, how many columns to the right should it look to grab the data you actually want? If Employee ID is Column 1, Department is Column 2, and Salary is Column 3, you type the number 3.
Add to your formula:3, - range_lookup: Do you want an exact match or an approximate match? In 99% of business cases, you want an exact match. To tell Excel you demand an exact match, type the word FALSE.
Finish the formula:FALSE)
Your final formula looks like this: =VLOOKUP(A2, Sheet2!$A$2:$D$500, 3, FALSE).
Press Enter, and the correct salary will instantly appear next to the employee’s name. You can now drag the formula down the entire column, matching all 500 records in three seconds.
Common VLOOKUP Errors
If you see an #N/A error, it usually means one of two things:
- The Employee ID literally does not exist on the second sheet.
- The formatting is broken (e.g., the ID on Sheet 1 is formatted as Text, but the ID on Sheet 2 is formatted as a Number. Excel considers these completely different values).
If you see a #REF! error, it usually means your column index number is wrong. You asked it to look in Column 5, but your highlighted table array only contains 4 columns.
Conclusion
Stop manually cross-referencing spreadsheets. By mastering the four parts of a VLOOKUP formula, you can instantly merge massive datasets and automate one of the most tedious tasks in the modern office.