How to Use VLOOKUP in Google Sheets

The VLOOKUP function in Google Sheets is a powerful tool that allows you to look up data in a table or range of cells. It is a vertical lookup function, which means that it searches for a value in the first column of a table and then returns the corresponding value from the column that you specify.

The VLOOKUP function has the following syntax:

=VLOOKUP(lookup_value, range, column_index_num, [is_sorted])

Where:

  • lookup_value is the value that you want to look up.
  • range is the range of cells that contains the data that you want to look up.
  • column_index_num is the number of the column that you want to return.
  • is_sorted is an optional argument that specifies whether the range is sorted.

Examples

Let’s say you have the following data in a spreadsheet:

Name | Age | City
------- | -------- | --------
John Doe | 30 | San Francisco
Jane Doe | 25 | New York
Bill Smith | 40 | Chicago

You can use the VLOOKUP function to look up the age of John Doe. To do this, you would use the following formula:

=VLOOKUP("John Doe", A2:C6, 2)

This formula would return the value in the second column of the range A2:C6 that matches the value “John Doe” in the first column. In this case, the formula would return the value 30.

You can also use the VLOOKUP function to look up the city of Jane Doe. To do this, you would use the following formula:

=VLOOKUP("Jane Doe", A2:C6, 3)

This formula would return the value in the third column of the range A2:C6 that matches the value “Jane Doe” in the first column. In this case, the formula would return the value “New York”.

Advanced usage

See also:  How to Add Numbers in Google Sheets

The VLOOKUP function can be used in a variety of ways to look up data in a spreadsheet. Here are a few advanced usage examples:

  • Looking up data in a sorted range

If the range that you are looking up is sorted, you can specify the is_sorted argument to improve the performance of the VLOOKUP function. For example, the following formula would look up the age of John Doe in a sorted range:

=VLOOKUP("John Doe", A2:C6, 2, TRUE)
  • Looking up data in a range that contains multiple columns

If the range that you are looking up contains multiple columns, you can specify the column_index_num argument to specify which column you want to return. For example, the following formula would look up the city of Jane Doe in a range that contains three columns:

=VLOOKUP("Jane Doe", A2:C6, 3)
  • Looking up data in a range that contains text

If the range that you are looking up contains text, you can specify the match_type argument to specify how the VLOOKUP function should match the lookup_value. The match_type argument can have the following values:

* **1:** Exact match
* **0:** Approximate match (uses the **MATCH** function to find the closest match)
* **-1:** Approximate match (ignores case)

For example, the following formula would look up the age of John Doe in a range that contains text:

=VLOOKUP("John Doe", A2:C6, 2, 1)

This formula would use the MATCH function to find the exact match for the value “John Doe” in the first column of the range. If there is no exact match, the VLOOKUP function will return #N/A.

Leave a Reply

Your email address will not be published.