Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

VLOOKUP Guide: How to Use the Formula Step by Step

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

VLOOKUP (Vertical Lookup) is a spreadsheet function used to search for a specific value in the first column of a data table and return a corresponding value from another column in the same row. It essentially acts as a digital phone book: you provide the name (the lookup value), and Excel or Google Sheets finds the phone number (the return value) associated with that name. This is essential for merging datasets, automating reports, and finding specific entries in thousands of rows of data without manual searching.

What You'll Need

  • A spreadsheet application (Microsoft Excel, Google Sheets, or LibreOffice Calc).
  • A source table containing the data you want to retrieve.
  • A unique identifier (like an ID number, email, or SKU) that exists in both your current cell and the source table.
  • The source table must be organized vertically, meaning data is arranged in columns.

Step-by-Step

  1. Identify Your Lookup Value: Determine the piece of information you already have and want to use to find more data. For example, if you have a list of Employee IDs and you want to find their corresponding email addresses, the Employee ID is your lookup value. This value should be entered in a cell (e.g., cell A2).
  2. Define the Table Array: Locate the range of cells that contains your master data. This is the "source" where the answer lives. Crucially, the column containing your lookup value must be the leftmost column of this range. For example, if your master list is in cells F1 through H100, and the Employee IDs are in column F, your table array is F1:H100.
  3. Determine the Column Index Number: Count the columns in your table array from left to right, starting with the lookup column as 1. If your table array is F1:H100, column F is 1, column G is 2, and column H is 3. If the email addresses you want to retrieve are in column H, your column index number is 3.
  4. Choose the Match Type: Decide if you need an exact match or an approximate match. In 99% of business cases, you need an exact match. For an exact match, use FALSE or 0. For an approximate match (used for tax brackets or grade scales), use TRUE or 1.
  5. Construct the Formula: Click the cell where you want the result to appear and type the formula using this syntax: =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]).
  6. Input the Specifics: Using our example, the formula would look like this: =VLOOKUP(A2, F1:H100, 3, FALSE). This tells the software: "Look for the value in A2, find it in the first column of the range F1:H100, and give me the value from the 3rd column of that row. Only do this if you find an exact match."
  7. Lock Your References: If you plan to drag this formula down to apply it to multiple rows, you must lock the table array using absolute references (dollar signs). Change F1:H100 to $F$1:$H$100. This prevents the range from shifting downward as you copy the formula. The final formula becomes: =VLOOKUP(A2, $F$1:$H$100, 3, FALSE).
  8. Execute and Verify: Press Enter. The cell should now display the value from the source table. To verify, manually check the source table to ensure the returned value matches the row associated with your lookup value.

Common Mistakes

One of the most frequent errors is placing the lookup value in a column that is not the first column of the selected range. VLOOKUP can only look to the right. If your unique identifier is in column B, but you want to retrieve data from column A, VLOOKUP cannot do this. You would need to rearrange your data or use a combination of INDEX and MATCH functions.

Another common error is forgetting to use the FALSE argument for exact matches. If you omit the fourth argument or set it to TRUE, the spreadsheet assumes the first column is sorted in ascending order. If the data is not sorted, the formula may return a completely incorrect value without giving you an error message, which can lead to dangerous data inaccuracies in financial reports.

Users also frequently forget to use absolute references (the $ signs). When you drag a formula down from row 2 to row 3, a relative reference like F1:H100 changes to F2:H101. This means the formula "misses" the top row of your data, often resulting in #N/A errors for values that actually exist at the top of your list.

Data type mismatches are a subtle but common pitfall. If your lookup value is stored as text (e.g., an ID number formatted as text) but the source table stores those same IDs as numbers, VLOOKUP will not recognize them as the same value and will return an error, even if they look identical to the human eye.

Tips

To make your spreadsheets more professional and easier to manage, consider using Named Ranges. Instead of highlighting F1:H100 and typing the coordinates, you can highlight that area, right-click, and select "Define Name" (or use the Name Box in the top left). Name it "EmployeeData". Your formula then becomes =VLOOKUP(A2, EmployeeData, 3, FALSE). This is much easier to read and eliminates the need for dollar signs.

If you are working with very large datasets, VLOOKUP can slow down your workbook because it recalculates frequently. To optimize performance, ensure your data is clean and free of unnecessary blank rows or columns within the table array. If you have access to newer versions of Excel (Office 365), consider using XLOOKUP, which is more flexible and faster than VLOOKUP.

When dealing with potential errors, wrap your VLOOKUP in an IFERROR function. Instead of seeing a messy #N/A when a value isn't found, you can display a custom message. For example: =IFERROR(VLOOKUP(A2, $F$1:$H$100, 3, FALSE), "Not Found"). This keeps your data clean and alerts you specifically to missing entries.

Always double-check for leading or trailing spaces in your data. A cell that contains "ID123 " (with a space at the end) is not the same as "ID123". Use the TRIM function to clean your data before running a VLOOKUP if you suspect your source data was imported from a messy CSV or external database.

Troubleshooting

If your formula returns #N/A, it means the value was not found. First, check if the lookup value actually exists in the first column of your table array. If it does, check for hidden spaces using the TRIM function. Next, verify that the data types match; ensure both the lookup cell and the source column are both formatted as "Number" or both as "Text".

If the formula returns the wrong value, check your column index number. Ensure you counted correctly from the left of your range. Also, verify that you used FALSE as the fourth argument. If you used TRUE or left it blank, the formula might be returning the closest match rather than the exact match.

If you see a #REF! error, it usually means your column index number is larger than the number of columns in your table array. For example, if your range is F1:G100 (2 columns) but your index number is 3, the formula is looking for a column that doesn't exist within the specified range.

If the formula returns #VALUE!, check for typos in the formula syntax. Ensure all arguments are separated by commas (or semicolons, depending on your regional settings) and that the range is correctly defined.

Frequently Asked Questions

Can VLOOKUP look to the left?

No, VLOOKUP can only search the leftmost column of a range and retrieve data from columns to the right. To look left, you must use the INDEX and MATCH functions together or use XLOOKUP.

Does VLOOKUP work across different sheets?

Yes. When selecting your table array, simply click over to the other sheet and highlight the range. The formula will automatically include the sheet name, looking something like 'Sheet2'!$F$1:$H$100.

What is the difference between VLOOKUP and HLOOKUP?

VLOOKUP stands for "Vertical Lookup" and searches columns. HLOOKUP stands for "Horizontal Lookup" and searches the top row of a table to return a value from a row below it.

Can VLOOKUP return multiple columns of data?

A single VLOOKUP formula can only return one value. To get data from multiple columns, you must write separate VLOOKUP formulas for each column, changing only the column index number.

Will VLOOKUP find the first or last match?

VLOOKUP always returns the first match it encounters as it searches from the top down. If you have duplicate IDs in your source table, it will ignore all subsequent matches.

Is VLOOKUP case-sensitive?

No, VLOOKUP is not case-sensitive. Searching for "APPLE" will return the same result as searching for "apple" or "Apple".