The Ultimate Guide to using VLOOKUP in Google Sheets

7 Dec, 2022
paresh
Paresh @Boloforms
11 min read
BoloForms

Create a free BoloForms account today!

Create your free account today and start creating your approval workflows.

Create Free Account

The VLOOKUP function in Google Sheets is used to search for a specific value in the first column of a table and return a corresponding value in the same row from another column of the table. For example, if you have a table that contains student names and their grades, you can use the VLOOKUP function to search for a specific student's name and return their grade.

To use the VLOOKUP function in Google Sheets, you need to provide the following arguments:

  1. search_key - The value you want to search for in the first column of the table. This can be a cell reference, a value, or a text string.
  2. range - The table of data you want to search. This should be the entire table, including the first column that contains the search key.
  3. index - The column number in the table from which the corresponding value should be returned. For example, if the value you want to return is in the third column of the table, you would use the number 3 as the index.
  4. [is_sorted] - This optional argument specifies whether the table is sorted in ascending order. If the table is sorted, you can set this argument to TRUE to perform a more efficient search. If the table is not sorted, you should set this argument to FALSE or leave it blank.

Here's an example of how to use the VLOOKUP function in Google Sheets to search for a student's name and return their grade:

=VLOOKUP(A1,A2:B6,2,FALSE)

In this example, the search_key is the value in cell A1, the range is the table in cells A2:B6, the index is 2 (the second column in the table), and the is_sorted argument is set to FALSE. This formula will search for the value in cell A1 in the first column of the table, and return the corresponding value in the second column of the same row.

You can also use the VLOOKUP function to search for multiple values in the same table and return multiple corresponding values. For example, if you have a table that contains a list of student names and their grades, you can use the VLOOKUP function to search for multiple student names and return their corresponding grades. Here's an example of how to do this:

=VLOOKUP(A1:A3,A2:B6,2,FALSE)

In this example, the search_key is the values in cells A1:A3, the range is the table in cells A2:B6, the index is 2 (the second column in the table), and the is_sorted argument is set to FALSE. This formula will search for the values in cells A1:A3 in the first column of the table, and return the corresponding values in the second column of the same rows.

How to use VLOOKUP within the same google sheet?

To use the VLOOKUP function within the same Google Sheets document, you can simply provide the cell references for the search key, the table, and the index within the formula. For example, if you want to search for a value in cell A1 and return a corresponding value from the table in cells B1:C10, you can use the following formula:

=VLOOKUP(A1,B1:C10,2,FALSE)

In this example, the search_key is the value in cell A1, the range is the table in cells B1:C10, the index is 2 (the second column in the table), and the is_sorted argument is set to FALSE. This formula will search for the value in cell A1 in the first column of the table, and return the corresponding value in the second column of the same row.

You can also use this formula to search for multiple values in the table and return multiple corresponding values. For example, if you have a list of values in cells A1:A3 and you want to search for those values in the table in cells B1:C10, you can use the following formula:

=VLOOKUP(A1:A3,B1:C10,2,FALSE)

In this example, the search_key is the values in cells A1:A3, the range is the table in cells B1:C10, the index is 2 (the second column in the table), and the is_sorted argument is set to FALSE. This formula will search for the values in cells A1:A3 in the first column of the table, and return the corresponding values in the second column of the same rows.

How to use VLOOKUP with wildcard characters?

You can use the VLOOKUP function in Google Sheets with wildcard characters to perform partial matches on your search key. Wildcard characters are special characters that can be used in text strings to match one or more characters. In Google Sheets, the two wildcard characters are the asterisk (*) and the question mark (?).

The asterisk (*) wildcard character is used to match any number of characters. For example, if you want to search for a value that contains the text "appl" followed by any number of other characters, you can use the following formula:

=VLOOKUP("appl*",A2:B6,2,FALSE)

In this example, the search key is "appl*", which will match any value that starts with "appl" followed by any number of other characters. The range is the table in cells A2:B6, the index is 2 (the second column in the table), and the is_sorted argument is set to FALSE. This formula will search for any value that starts with "appl" in the first column of the table, and return the corresponding value in the second column of the same row.

The question mark (?) wildcard character is used to match a single character. For example, if you want to search for a value that contains the text "appl" followed by a single character, you can use the following formula:

=VLOOKUP("appl?",A2:B6,2,FALSE)

In this example, the search key is "appl?", which will match any value that starts with "appl" followed by a single character. The range is the table in cells A2:B6, the index is 2 (the second column in the table), and the is_sorted argument is set to FALSE. This formula will search for any value that starts with "appl" and is followed by a single character in the first column of the table, and return the corresponding value in the second column of the same row.

How to do a case-sensitive VLOOKUP?

By default, the VLOOKUP function in Google Sheets is not case-sensitive, which means it will return a match regardless of the case of the search key and the values in the table. If you want to perform a case-sensitive VLOOKUP, you can use the IFERROR function along with the EXACT function to check if the search key and the values in the table match exactly, including the case.

For example, if you want to search for the value "apple" in the table in cells A2:B6 and return the corresponding value in the second column of the table only if the case matches exactly, you can use the following formula:

=IFERROR(VLOOKUP(A1,A2:B6,2,FALSE),IFERROR(VLOOKUP(EXACT(A1,A2:A6),A2:B6,2,FALSE),"No match"))

In this example, the VLOOKUP function is used twice, once to perform a regular search for the value in cell A1 in the first column of the table, and again to search for the exact match of the value in cell A1 in the first column of the table. If the first VLOOKUP function returns an error because it didn't find a match, the second VLOOKUP function is used to search for the exact match. If both VLOOKUP functions return an error, the IFERROR function returns "No match".

How to use VLOOKUP in another sheet within the same Google spreadsheet file?

To use the VLOOKUP function in another sheet within the same Google Sheets document, you can use a combination of the INDIRECT and VLOOKUP functions. The INDIRECT function takes a cell reference in the form of a text string and converts it into an actual cell reference, which can then be used by other functions.

For example, if you want to search for a value in cell A1 on Sheet1 and return a corresponding value from the table on Sheet2, you can use the following formula:

=VLOOKUP(A1,INDIRECT("Sheet2!A2:B6"),2,FALSE)

In this example, the search_key is the value in cell A1 on Sheet1, the range is the table on Sheet2 in cells A2:B6, the index is 2 (the second column in the table), and the is_sorted argument is set to FALSE. This formula will search for the value in cell A1 on Sheet1 in the first column of the table on Sheet2, and return the corresponding value in the second column of the same row.

You can also use this formula to search for multiple values on Sheet1 and return multiple corresponding values from the table on Sheet2. For example, if you have a list of values in cells A1:A3 on Sheet1 and you want to search for those values in the table on Sheet2, you can use the following formula:

=VLOOKUP(A1:A3,INDIRECT("Sheet2!A2:B6"),2,FALSE)

In this example, the search_key is the values in cells A1:A3 on Sheet1, the range is the table on Sheet2 in cells A2:B6, the index is 2 (the second column in the table), and the is_sorted argument is set to FALSE. This formula will search for the values in cells A1:A3 on Sheet1 in the first column of the table on Sheet2, and return the corresponding values in the second column of the same rows.

How to use VLOOKUP in another sheet in a different Google spreadsheet file?

To use the VLOOKUP function in another sheet in a different Google Sheets document, you can use the IMPORTRANGE function in combination with the VLOOKUP function. The IMPORTRANGE function allows you to import data from one Google Sheets document to another, so you can use it to import the data from the other sheet into the current sheet and then use the VLOOKUP function to search for a value and return a corresponding value from the imported data.

Here's an example of how to use the IMPORTRANGE and VLOOKUP functions to search for a value in another sheet in a different Google Sheets document:

=VLOOKUP(A1,IMPORTRANGE("https://docs.google.com/spreadsheets/d/spreadsheet_id","Sheet1!A2:B6"),2,FALSE)

In this example, the search_key is the value in cell A1 on the current sheet, the range is the table on Sheet1 in the other document, the index is 2 (the second column in the table), and the is_sorted argument is set to FALSE. This formula will import the data from Sheet1 in the other document, search for the value in cell A1 in the first column of the imported data, and return the corresponding value in the second column of the same row.

Note that in order to use the IMPORTRANGE function, you need to share the other Google Sheets document with the email address of the current document, and you also need to provide the spreadsheet ID of the other document in the formula.

How to use VLOOKUP if my search column isn’t the first column in the lookup table?

By default, the VLOOKUP function in Google Sheets searches for a value in the first column of the lookup table and returns a corresponding value from the same row in another column of the table. If your search column is not the first column in the table, you can use the INDEX and MATCH functions together to find the row that contains the search key and then use the VLOOKUP function to return a corresponding value from that row.

Here's an example of how to use the INDEX, MATCH, and VLOOKUP functions to search for a value in a different column of the lookup table:

=VLOOKUP(A1,A2:B6,MATCH(B1,A2:A6,0),FALSE)

In this example, the search_key is the value in cell A1, the range is the table in cells A2:B6, the index is the column number that contains the search key (which is determined by the MATCH function), and the is_sorted argument is set to FALSE. This formula will use the MATCH function to find the row that contains the search key in the first column of the table, and then use the VLOOKUP function to return the corresponding value from that row in the second column of the table.

How to return more than a single column with VLOOKUP?

By default, the VLOOKUP function in Google Sheets returns a single column from the lookup table based on the index argument that you provide. If you want to return more than one column from the table, you can use the INDEX function to return an array of values from multiple columns and then use the TRANSPOSE function to convert the array into a row of values.

Here's an example of how to use the INDEX, TRANSPOSE, and VLOOKUP functions to return multiple columns from the lookup table:

=TRANSPOSE(INDEX(A2:C6,MATCH(A1,A2:A6,0),{1,2,3}))

In this example, the search_key is the value in cell A1, the range is the table in cells A2:C6, the index is the array of column numbers {1,2,3}, which specifies the columns that should be returned, and the is_sorted argument is not used. This formula will use the MATCH function to find the row that contains the search key in the first column of the table, and then use the INDEX function to return an array of values from the specified columns of that row. Finally, the TRANSPOSE function is used to convert the array into a row of values.

How to perform a VLOOKUP using multiple input criteria?

To perform a VLOOKUP using multiple input criteria, you can use the INDEX, MATCH, and VLOOKUP functions together to search for multiple values in the lookup table and return a corresponding value from the same row.

Here's an example of how to use the INDEX, MATCH, and VLOOKUP functions to perform a VLOOKUP with multiple input criteria:

=VLOOKUP(A1,A2:B6,MATCH(B1,B2:B6,0),FALSE)

In this example, the search_key is the value in cell A1, the range is the table in cells A2:B6, the index is the column number that contains the second search key (which is determined by the MATCH function), and the is_sorted argument is set to FALSE. This formula will use the MATCH function to find the row that contains the second search key in the second column of the table, and then use the VLOOKUP function to return the corresponding value from that row in the first column of the table.

You can also use this formula to search for multiple values in multiple columns and return multiple corresponding values from the same row. For example, if you have a list of values in cells A1:A3 and B1:B3 and you want to search for those values in the table in cells A2:B6, you can use the following formula:

=VLOOKUP(A1:A3,A2:B6,MATCH(B1:B3,B2:B6,0),FALSE)

In this example, the search_key is the values in cells A1:A3, the range is the table in cells A2:B6, the index is the array of column numbers that contains the second search keys (which is determined by the MATCH function), and the is_sorted argument is set to FALSE. This formula will use the MATCH function to find the rows that contain the second search keys in the second column of the table, and then use the VLOOKUP function to return the corresponding values from those rows in the first column of the table.

How to combine data from multiple google sheets into one sheet?

To combine data from multiple Google Sheets into one sheet, you can use the IMPORTRANGE function. This function takes two arguments: the URL of the source sheet and a range of cells to import. Here's an example of how you could use the IMPORTRANGE function to import data from multiple sheets:

=IMPORTRANGE("spreadsheet_url", "Sheet1!A1:D10")

in this formula, we have the URL of the source sheet, and "Sheet1!A1:D10" is the range of cells to import. This formula will import the data in the range A1:D10 on Sheet1 of the source sheet into the current sheet.

To import data from multiple sheets, you can use multiple IMPORTRANGE functions in the same formula, separated by a comma. For example:

=IMPORTRANGE("spreadsheet_url1", "Sheet1!A1:D10"), IMPORTRANGE("spreadsheet_url2", "Sheet2!A1:D10")

This formula will import the data in the range A1:D10 on Sheet1 and Sheet2 of the source sheet into the current sheet.

What are some of the reasons why VLOOKUP does not work correctly?

There are several reasons why the VLOOKUP function may not work correctly in Google Sheets. Some common reasons include:

  • Incorrect cell references: Make sure you are using the correct cell references for the search key, the lookup table, and the index in the formula.
  • Incorrect range: Make sure the range you specify in the formula includes the entire lookup table, including the search column and the columns that contain the values you want to return.
  • Incorrect index: Make sure you are specifying the correct column number for the index argument in the formula. This should be the column number of the column that contains the values you want to return, not the column number of the search column.
  • Incorrect is_sorted argument: If the is_sorted argument is set to TRUE, the values in the search column must be sorted in ascending order for the VLOOKUP function to work correctly.
  • Text format: If the search key and the values in the lookup table have different text formats (e.g. one is in upper case and the other is in lower case), the VLOOKUP function may not be able to find a match. In this case, you can use the UPPER or LOWER functions to convert the text to the same format before using the VLOOKUP function.

Limited-time offer
Get lifetime access to BoloForms Approvals for FREE!
Includes :
Unlimited Forms and Responses
Unlimited Users
Unlimited Requestors
Unlimited Approvers/Collaborators
Multi-Level & Multi-Stage Workflows
Generate & Send PDF Docs
Reminder Notifications for Approvals
Google Sheets, Xero & Notion Integration
Conditional Statements
Static & Dynamic Recipients
Prefill Forms
Bulk Submit Approval Requests
24/7 support

(act fast as this exclusive offer won't last forever!)

Free Forever
No credit card required