Google Sheets Function: VLOOKUP

The VLOOKUP function searches for a value in the first column of a cell range and then returns the value of a cell that is on the same row.


=VLOOKUP(search_key, range, index, is_sorted)

Example of use

The objective here is to be able to enter the file number in cell E2 and then automatically obtain the desired information in the blue cells.

To start, the formula in cell G2 should return the name of the city:

google sheets vlookup

Enter into the VLOOKUP function:

The formula here is:

google sheets function vlookup

To then display the number of points, simply copy the formula and change the column number (replace 2 with 3):

google sheets function vlookup search
If needed, you can copy the Google Sheets document (or view the document) with this example.
In this case, if the file number is not found, an error is returned. To return a value instead of this error, use the IFERROR function.
Since the VLOOKUP function searches for the value in the first column of the range, the results cannot be located to the left of the search column. To perform a search in a column that is not necessarily the first of the range, use the XLOOKUP function.