The VLOOKUP (Vertical Lookup) function in Microsoft Excel allows you to search for a specific value in the first column of a table and return a corresponding value from another column in the same row. It is primarily used to merge data from two different lists or to retrieve information from a large database based on a unique identifier, such as an ID number or a product code.

What You'll Need

  • A computer with Microsoft Excel installed (all versions support VLOOKUP).
  • A dataset organized in a table or range where the "lookup value" is located in the leftmost column of the data range.
  • A specific value you want to search for (the "lookup value").

Step-by-Step

  1. Prepare your data: Ensure your data is organized in columns. The value you are searching for must be in the very first column of the range you select. For example, if you are looking up a customer's email using their Customer ID, the Customer ID column must be to the left of the Email column.
  2. Select the cell: Click on the cell where you want the result of the VLOOKUP to appear.
  3. Enter the function: Type =VLOOKUP( into the cell. This opens the function arguments.
  4. Define the Lookup Value: Type the value you are searching for or click on the cell that contains the value. For example, if cell A2 contains the ID you are searching for, the formula starts as =VLOOKUP(A2,. Then, type a comma.
  5. Select the Table Array: Highlight the range of cells that contains both the lookup value and the data you want to retrieve. For example, if your data is in cells G1 through I100, select that range. Your formula should now look like =VLOOKUP(A2, G1:I100,. Type another comma.
  6. Enter the Column Index Number: Count the columns in your selected range from left to right, starting with 1. If the data you want to retrieve is in the third column of your selection, type 3. Your formula now looks like =VLOOKUP(A2, G1:I100, 3,. Type one last comma.
  7. Specify the Range Lookup: Decide if you want an exact match or an approximate match.
    • Type FALSE (or 0) for an Exact Match. This is the most common choice and ensures you get the precise piece of data associated with your lookup value.
    • Type TRUE (or 1) for an Approximate Match. This is typically used for tiered data, like tax brackets or grading scales.
    The formula should now be =VLOOKUP(A2, G1:I100, 3, FALSE).
  8. Complete the formula: Close the parentheses ) and press Enter.

Common Mistakes

  • Lookup value not in the first column: VLOOKUP only searches the leftmost column of the selected range. If your search key is in the second column, VLOOKUP will not find it.
  • Incorrect Column Index: Counting the columns based on the entire spreadsheet rather than the selected range. The index number must be relative to the range you highlighted.
  • Forgetting the Range Lookup: If you omit the final FALSE or TRUE, Excel defaults to TRUE. This often leads to incorrect results if your data is not sorted alphabetically or numerically.
  • Including headers in the range: While not always a mistake, including headers can sometimes lead to confusion if you are using approximate matches.

Tips

  • Use Absolute References: If you plan to drag the VLOOKUP formula down to apply it to multiple rows, lock your table array using dollar signs (e.g., $G$1:$I$100). This prevents the search range from shifting as you copy the formula.
  • Named Ranges: Instead of selecting G1:I100, you can highlight that area and name it "CustomerData" in the Name Box (top left). Your formula becomes =VLOOKUP(A2, CustomerData, 3, FALSE), which is much easier to read.
  • Data Cleaning: Ensure there are no leading or trailing spaces in your lookup values or your table array, as "ID101" is not the same as "ID101 " in Excel's eyes.

Troubleshooting

If your VLOOKUP is not returning the expected result, try these steps in order:

  1. Check for #N/A errors: This usually means the value you are looking for does not exist in the first column of your range. Double-check for typos or hidden spaces.
  2. Verify Data Types: Ensure both the lookup value and the first column of the table are the same format. If one is formatted as "Text" and the other as "Number," VLOOKUP will return an #N/A error even if they look identical.
  3. Check the Column Index: If you get a #REF! error, it means your column index number is larger than the number of columns in your selected range (e.g., you asked for column 4, but only selected 3 columns).
  4. Confirm the Range Lookup: If you are getting a result, but it is the wrong one, ensure you used FALSE for an exact match.

Frequently Asked Questions

Can VLOOKUP look to the left?

No, VLOOKUP can only search the leftmost column and retrieve data to the right. To look to the left, you must use the INDEX and MATCH functions together or the XLOOKUP function in newer versions of Excel.

What is the difference between TRUE and FALSE in VLOOKUP?

FALSE requires an exact match; if the value isn't found, it returns an error. TRUE finds the closest match that is less than or equal to the lookup value, which requires the first column to be sorted in ascending order.

Does VLOOKUP work across different sheets?

Yes. When selecting the Table Array, you can click on a different worksheet tab and highlight the range there. Excel will automatically add the sheet name to the formula.

Will VLOOKUP find multiple results?

No, VLOOKUP only returns the first match it encounters. If there are multiple instances of the lookup value, only the first one (from the top) will be returned.

Is XLOOKUP better than VLOOKUP?

XLOOKUP is a more powerful successor available in Microsoft 365 and Excel 2021. It can look both left and right, defaults to an exact match, and is generally more flexible.