VLOOKUP
VLOOKUP Interview with follow-up questions
1. Can you explain how the VLOOKUP function works in Excel?
VLOOKUP (Vertical Lookup) searches for a value in the leftmost column of a table and returns a value from a specified column to the right in the same row.
Syntax:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
- lookup_value — the value to search for.
- table_array — the range containing the data; the search column must be the first (leftmost) column.
- col_index_num — the column number within table_array to return (1 = first column, 2 = second, etc.).
- range_lookup —
FALSEfor an exact match (use this almost always);TRUEor omitted for approximate match (requires the first column to be sorted ascending).
Example:
=VLOOKUP(A2, $D$2:$F$100, 2, FALSE)
Looks up the value in A2 in column D, and returns the corresponding value from column E.
VLOOKUP limitations — and the modern alternative: VLOOKUP has several well-known weaknesses:
- The lookup column must be the leftmost column in the range — you cannot look left.
- The column index is a hard-coded number that breaks if columns are inserted or deleted.
- It returns the first match only.
- It cannot return multiple columns in one formula.
In 2025 interviews, be ready to discuss XLOOKUP, which replaces VLOOKUP:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])
XLOOKUP can look in any direction, returns an exact match by default, handles "not found" gracefully, and can return multiple columns at once. Know both, but position XLOOKUP as the current best practice.
Follow-up 1
Can you provide an example where you have used VLOOKUP?
Sure! Here's an example where I have used the VLOOKUP function:
Suppose you have a table of student names and their corresponding grades. You want to find the grade of a specific student based on their name. You can use the VLOOKUP function to do this.
Assuming the student names are in column A and the grades are in column B, you can use the following formula:
=VLOOKUP("John", A1:B10, 2, FALSE)
This formula will search for the name "John" in the leftmost column of the range A1:B10 and return the corresponding grade from the second column of the range.
Note that the FALSE argument in the formula ensures that an exact match is required.
Follow-up 2
What are the limitations of VLOOKUP?
The VLOOKUP function in Excel has some limitations:
VLOOKUP can only search for values in the leftmost column of a range or table. If you need to search for values in a different column, you will need to rearrange your data or use a different function.
VLOOKUP can only return values from a column to the right of the lookup column. If you need to retrieve values from a column to the left of the lookup column, you will need to use a combination of functions like INDEX and MATCH.
VLOOKUP can only perform approximate matches or exact matches. It cannot perform wildcard matches or case-insensitive matches without additional functions.
VLOOKUP is not suitable for large datasets or dynamic ranges as it can be slow and may not update automatically when the range changes.
It's important to be aware of these limitations when using the VLOOKUP function.
Follow-up 3
How does VLOOKUP differ from HLOOKUP?
The VLOOKUP and HLOOKUP functions in Excel are similar, but they differ in how they perform lookups:
VLOOKUP stands for vertical lookup and is used to search for a value in the leftmost column of a range or table, and then return a corresponding value from a specified column in the same row.
HLOOKUP stands for horizontal lookup and is used to search for a value in the top row of a range or table, and then return a corresponding value from a specified row in the same column.
In other words, VLOOKUP looks vertically (up and down) for a value, while HLOOKUP looks horizontally (left and right) for a value.
The syntax and usage of VLOOKUP and HLOOKUP are similar, but the main difference is the orientation of the lookup.
Follow-up 4
What are some common errors you might encounter when using VLOOKUP?
When using the VLOOKUP function in Excel, you might encounter the following common errors:
#N/A: This error occurs when the lookup value is not found in the leftmost column of the range or table. Make sure the lookup value exists in the range you are searching.
#REF!: This error occurs when the range or table specified in the formula is incorrect or has been deleted. Double-check the range or table references in your formula.
#VALUE!: This error occurs when one of the arguments in the formula is of the wrong data type. Make sure all arguments are of the correct data type.
#NUM!: This error occurs when the
col_index_numargument is less than 1 or greater than the number of columns in the range or table. Check that thecol_index_numis within the valid range.
It's important to handle these errors properly to ensure the accuracy of your VLOOKUP results.
2. What are the parameters of the VLOOKUP function?
VLOOKUP takes four parameters:
VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
lookup_value — the value you are searching for. Can be a cell reference, a text string in quotes, a number, or a formula result. Must match a value in the first column of
table_array.table_array — the range that contains both the lookup column (must be leftmost) and the return column(s). Use absolute references (
$D$2:$F$100) so the range does not shift when you copy the formula down.col_index_num — a positive integer specifying which column in
table_arrayto return.1returns the lookup column itself,2returns the next column, and so on. This is a known fragility — inserting a column into the table shifts the index without updating the formula.range_lookup (optional) —
FALSE(or0) requires an exact match and is almost always what you want.TRUE(or1, or omitted) performs an approximate match and requires the first column to be sorted in ascending order; it is mainly used for tiered lookups like tax brackets or commission rates.
Interview tip: Interviewers frequently ask about the difference between TRUE and FALSE here. Always use FALSE unless you specifically need approximate matching, because omitting this argument defaults to TRUE, which can silently return wrong results on unsorted data.
Modern context: XLOOKUP (=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])) eliminates the fragile column-index parameter and is the recommended approach in Excel 365 / Excel 2021+.
Follow-up 1
What does each parameter represent?
Each parameter of the VLOOKUP function represents the following:
Lookup_value: This is the value that you want to search for in the first column of the table or range.
Table_array: This is the table or range where the data is stored. The first column of the table or range must contain the lookup_value.
Col_index_num: This is the column number in the table or range that contains the value you want to return.
Range_lookup: This is an optional parameter that specifies whether you want an exact match or an approximate match. If this parameter is set to TRUE or omitted, an approximate match is performed. If it is set to FALSE, an exact match is performed.
Follow-up 2
What happens if you omit one of the parameters?
If you omit one of the parameters of the VLOOKUP function, Excel will return an error. Each parameter is required for the function to work correctly. Make sure to provide all the necessary parameters when using the VLOOKUP function.
Follow-up 3
How does the range_lookup parameter affect the result?
The range_lookup parameter in the VLOOKUP function affects the result in the following ways:
If range_lookup is set to TRUE or omitted, an approximate match is performed. This means that if an exact match is not found, Excel will return the closest match that is less than the lookup_value.
If range_lookup is set to FALSE, an exact match is performed. This means that if an exact match is not found, Excel will return an error value (#N/A).
It is important to choose the appropriate value for range_lookup based on the desired behavior of the VLOOKUP function.
3. How would you use VLOOKUP to find a specific value in a large dataset?
In practice, XLOOKUP is now the preferred function for this task in Excel 365 / 2021+, but you should know both approaches.
XLOOKUP (modern, recommended):
=XLOOKUP(G2, A2:A10000, C2:C10000, "Not found")
- Searches column A for the value in G2, returns the matching value from column C.
- The fourth argument handles missing values gracefully instead of returning
#N/A. - No column-index number — you reference the return column directly, so inserting columns never breaks it.
VLOOKUP (classic approach):
=VLOOKUP(G2, $A$2:$D$10000, 3, FALSE)
- Searches the first column of the range for G2's value and returns column 3.
- Use absolute references (
$) so the formula copies correctly down the sheet. - Always use
FALSEfor the fourth argument to require an exact match.
Performance tips for large datasets:
- Format the source data as an Excel Table (Ctrl+T) and reference the table column by name — this is more readable and self-documenting.
- If you need to look up the same value repeatedly, consider a helper column or a named range for the lookup array.
- For very large datasets, Power Query or Power Pivot can perform joins more efficiently than worksheet lookup functions.
Error handling:
=IFERROR(VLOOKUP(G2, $A$2:$D$10000, 3, FALSE), "Not found")
=XLOOKUP(G2, A2:A10000, C2:C10000, "Not found") ' XLOOKUP has built-in error text
Follow-up 1
What steps would you take to ensure the accuracy of your results?
To ensure the accuracy of the results when using VLOOKUP, you can take the following steps:
- Double-check the value you are looking for to make sure it is correct.
- Verify that the range you are searching in includes the correct data.
- Check that the column index you are specifying is accurate and corresponds to the correct column in the range.
- Ensure that you have selected the correct match type (exact or approximate) depending on your requirements.
- Check for any errors in the formula syntax or cell references.
- Test the VLOOKUP formula with different values to verify that it returns the expected results.
By following these steps, you can minimize the chances of errors and ensure the accuracy of your VLOOKUP results.
Follow-up 2
How would you handle errors or missing values?
When handling errors or missing values in VLOOKUP, you can use the IFERROR function to display a custom message or value instead of the default #N/A error. Here's an example:
=IFERROR(VLOOKUP(value, range, column_index, exact_match), "Value not found")
In this example, if the VLOOKUP function returns an error, such as when the value is not found, the IFERROR function will display the custom message "Value not found" instead of the error.
Additionally, you can use other error-handling functions like ISERROR or ISNA to check for errors and perform specific actions based on the result. For example:
=IF(ISERROR(VLOOKUP(value, range, column_index, exact_match)), "Value not found", VLOOKUP(value, range, column_index, exact_match))
This formula checks if the VLOOKUP function returns an error and displays the custom message if it does, otherwise it displays the VLOOKUP result.
Follow-up 3
What would you do if the value you're looking for is not found?
If the value you're looking for is not found when using VLOOKUP, you can handle it in different ways depending on your requirements:
Display a custom message or value: You can use the IFERROR function, as mentioned earlier, to display a custom message or value instead of the default #N/A error.
Return a default value: Instead of displaying an error or custom message, you can specify a default value to be returned when the value is not found. For example:
=IFERROR(VLOOKUP(value, range, column_index, exact_match), default_value)
In this case, if the VLOOKUP function returns an error, the IFERROR function will return the specified default value.
- Perform additional actions: You can use other functions or formulas to perform additional actions when the value is not found. For example, you can use the IF function to check if the VLOOKUP result is an error and perform a specific action based on the result.
By considering these options, you can handle situations where the value you're looking for is not found and customize the behavior of your VLOOKUP formula.
4. Can you explain the difference between an exact match and an approximate match in VLOOKUP?
The range_lookup (fourth) argument in VLOOKUP controls whether the match must be exact or can be approximate.
Exact match (FALSE or 0):
- The lookup value must match a value in the first column precisely (same data type, same characters).
- Returns
#N/Aif no exact match is found — useIFERRORorIFNAto handle this. - Use this in almost every scenario where you are joining data by an ID, name, code, or other key.
excel =VLOOKUP(A2, $D$2:$F$100, 2, FALSE)
Approximate match (TRUE, 1, or omitted):
- Excel scans the first column (which must be sorted ascending) and returns the largest value that is less than or equal to the lookup value.
- Used for range-based lookups: tax brackets, commission tiers, grade bands.
- If the first column is not sorted, results are unpredictable and wrong — a silent, dangerous error.
excel ' Grade lookup: 0=F, 60=D, 70=C, 80=B, 90=A (sorted) =VLOOKUP(score, $H$2:$I$6, 2, TRUE)
Modern note: XLOOKUP offers a cleaner way to handle both cases and adds a fifth parameter for explicit match mode (0 = exact, -1 = exact or next smaller, 1 = exact or next larger, 2 = wildcard). This makes the intent clearer than VLOOKUP's TRUE/FALSE convention.
Follow-up 1
In what situations would you use an exact match?
An exact match in VLOOKUP is useful when you want to find an exact value in the lookup range. For example, if you have a list of employee names and you want to find the salary of a specific employee, you would use an exact match to ensure that you are retrieving the correct salary for that employee.
Follow-up 2
In what situations would you use an approximate match?
An approximate match in VLOOKUP is useful when you want to find the closest match to a given value in the lookup range. This is commonly used when you have a range of values and you want to find the value that is closest to a target value. For example, if you have a list of product prices and you want to find the price of a product that is closest to a specific target price, you would use an approximate match.
Follow-up 3
How does Excel determine what is an 'approximate' match?
In VLOOKUP, Excel determines an approximate match by finding the closest value in the lookup range that is less than or equal to the lookup value. It does this by comparing the lookup value with the values in the lookup range and finding the value that is closest without going over. Excel assumes that the lookup range is sorted in ascending order for this to work correctly.
5. How would you use VLOOKUP in combination with other Excel functions?
VLOOKUP is often nested inside other functions to handle errors, add conditions, or build more dynamic lookups. With Excel 365, many of these patterns are cleaner with XLOOKUP or INDEX/MATCH.
Error handling with IFERROR / IFNA:
=IFERROR(VLOOKUP(A2, $D$2:$F$100, 2, FALSE), "Not found")
=IFNA(VLOOKUP(A2, $D$2:$F$100, 2, FALSE), 0) ' treat missing as 0
IFNA is preferred over IFERROR because it only catches #N/A, not formula errors that might indicate a different problem.
Dynamic column index with MATCH:
=VLOOKUP(A2, $D$2:$Z$100, MATCH("Price", $D$1:$Z$1, 0), FALSE)
MATCH finds the column position of "Price" in the header row, so inserting a column never breaks the formula.
Conditional lookup with IF:
=VLOOKUP(A2, IF(B2="East", $D$2:$F$50, $G$2:$I$50), 2, FALSE)
Selects a different lookup table based on a condition.
Two-way lookup (row and column):
=INDEX(data, MATCH(row_key, row_range, 0), MATCH(col_key, col_range, 0))
INDEX/MATCH is more flexible than VLOOKUP for two-way lookups and is not limited to searching the leftmost column.
Modern equivalent: In Excel 365, XLOOKUP with nested XLOOKUP, or FILTER, replaces most of these patterns more readably:
=XLOOKUP(A2, D2:D100, F2:F100, "Not found")
Know the VLOOKUP combinations for backward-compatibility questions, but position XLOOKUP and INDEX/MATCH as the current best practice.
Follow-up 1
Can you give an example of using VLOOKUP with the IF function?
Sure! Here's an example of using VLOOKUP with the IF function:
=IF(VLOOKUP(A2, B2:C10, 2, FALSE) > 0, "Found", "Not Found")
In this example, the VLOOKUP function is used to search for the value in cell A2 in the range B2:C10. If the value is found, the IF function returns "Found", otherwise it returns "Not Found".
You can customize the result based on your specific requirements. For example, you can use different text or values instead of "Found" and "Not Found", or you can perform different calculations based on the result of the VLOOKUP.
Follow-up 2
How would you use VLOOKUP with the MATCH function?
To use VLOOKUP with the MATCH function, you can use the MATCH function to find the position of a value in a range, and then use that position as the lookup value in the VLOOKUP function.
Here's an example:
=VLOOKUP(MATCH(A2, B2:B10, 0), C2:D10, 2, FALSE)
In this example, the MATCH function is used to find the position of the value in cell A2 in the range B2:B10. The result of the MATCH function is then used as the lookup value in the VLOOKUP function, which searches for the value in the range C2:D10 and returns the corresponding value from the second column.
This can be useful when you want to perform a VLOOKUP based on a dynamic value that may change.
Follow-up 3
What are some other functions that can be used effectively with VLOOKUP?
In addition to the IF and MATCH functions, there are several other functions that can be used effectively with VLOOKUP. Some examples include:
INDEX function: The INDEX function can be used to return a value from a specific column in a table, based on the result of the VLOOKUP. This can be useful when you want to retrieve a specific value from a table based on a lookup value.
CONCATENATE function: The CONCATENATE function can be used to combine the result of the VLOOKUP with other text or values. This can be useful when you want to create a custom text string that includes the result of the VLOOKUP.
SUMIF function: The SUMIF function can be used to sum values in a range based on a condition. This can be useful when you want to sum values that meet a certain criteria, which can be determined using VLOOKUP.
These are just a few examples, but there are many other Excel functions that can be used in combination with VLOOKUP to perform various calculations and data manipulations.
Live mock interview
Mock interview: VLOOKUP
- Read your scene and goals
- Talk it out; goals tick off live
- Get a score and stronger lines
Your voice and your AI key never touch our servers; the key stays in this browser and is sent only to Google. Only your round scores are saved to track progress.