17.8 C
London
Sunday, June 22, 2025
HomeSoftware TutorialsGoogle SheetsHow to Find the Closest Value in Google Sheets (With Examples)

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

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

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.

Additional Resources

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

Google Sheets: How to Use COUNTIF From Another Sheet
Google Sheets: How to Use COUNTIF with Multiple Ranges
Google Sheets: How to Use COUNTIFS with a Date Range

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories