How to Find the Closest Value in Google Sheets (With Examples)

To find the closest value in Google Sheets, you can use the VLOOKUP, HLOOKUP, MIN, and MAX functions. VLOOKUP and HLOOKUP allow you to search for a value in a table and return the closest match, while MIN and MAX allow you to find the minimum or maximum value in a range of cells. Each of these functions can be used to search for the closest value in Google Sheets. Examples of how to use these functions are provided in the link.


You can use the following methods to find the closest value to some number in Google Sheets:

Method 1: Find Closest Value

=FILTER(A2:B15,ABS(D2-B2:B15)=min(ABS(D2-B2:B15)))

This method finds the row in the range A2:B15 where the value in the range B2:B15 is closest to the value in cell D2.

Method 2: Find Closest Value (Greater Than)

=QUERY(A2:B15,"select A, B where B >= "&D2&" order by B limit 1",0)

This method finds the row in the range A2:B15 where the value in column B is closest to the value in cell D2 and is also greater than or equal to the value in cell D2.

The following examples show how to use each method with the following dataset in Google Sheets:

Example 1: Find Closest Value

We can use the following formula to find the row in A2:B15 where the “points” value is closest to 31:

=FILTER(A2:B15,ABS(D2-B2:B15)=min(ABS(D2-B2:B15)))

The following screenshot shows how to use this formula in practice:

Google Sheets find closest value

The team with the points value closest to 31 is the Hornets. They had 30 points.

Example 2: Find Closest Value (Greater Than)

We can use the following formula to find the row in A2:B15 where the “points” value is closest to 31 and is also greater than or equal to 31:

=QUERY(A2:B15,"select A, B where B >= "&D2&" order by B limit 1",0)

The following screenshot shows how to use this formula in practice:

Google Sheets find closest value greater than

The team with the points value closest to 31 while being equal to or greater than 31 is the Knicks. They had 36 points.

The following tutorials explain how to perform other common operations in Google Sheets:

x