Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to find closest or nearest value in Excel?

Supposing you have a list of numbers in a column, and now you are required to find out the closest or nearest value to a given value from the list of numbers. How do you deal with it? Actually, you can find closest value or nearest value in Excel with following steps.

Find the closest or nearest value with array formula

Easily select all closest values in deviation range of given value with Kutools for Excel

Easily select similar cells by formatting (font color/background color) in Excel

For example I need to select all similar cells by the yellow background color from the specified Range A4:C22. With Kutools for Excel’s Select Cells with Format utility, you can archive it with just several clicks. Full Feature Free Trial 60-day!

ad select cells by bg color

Excel Productivity Tools

Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial

Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately.60-day Unlimited Free Trial

For example, you have a list of numbers in Column A, and now you will find the closest value or the nearest value of 18 from the Column A. You can do it as follows:

1. Select a blank cell; in this case, we select the Cell D2, and enter the formula of =INDEX(A1:A20,MATCH(MIN(ABS(A1:A20-D1)),ABS(A1:A20-D1),0)) into the cell D2.

Note: In above formula, A1:A20 is the range that you want to find the specific value, and D1 is the searching value that you want to be compared with.

note ribbon Formula is too complicated to remember? Save the formula as an Auto Text entry for reusing with only one click in future!
Read more…     Free trial

2. Press the Ctrl + Shift + Enter keys together to apply the formula. Then it displays the closest value to the given searching value. See the following screenshot:

Sometimes, you may want to find out and select all closet values to the given value in a range. Actually, we can define a deviation value, and then apply Kutools for Excel’s Select Special Cells utility to find out and select all closest values within the diviation range of give value easily.

Kutools for Excel - Combines more than 300 Advanced Functions and Tools for Microsoft Excel

For example, in our example we define the deviation value as 2, and the given value is 18. Therefore, we need to find out and select values between 16 (=18-2) and 20 (=18+2). Please view following steps:

1. Select the range where you will search for closest values to the give value, and then click Kutools > Select > Select Specific Cells.

2. In the opening Select Specific Cells dialog box, please:

(1) Check the Cell option in the Selection type section;

(2) In the Specific type section, click the first drop down list and select Greater than or equal to from it and type 16 into following box, and then select Less than or equal to from the second drop down list and type 20 into following box. See left screenshot:


Free Download Kutools for Excel Now

3. Click the Ok button to apply this utility. Then a dialog box comes out and shows you how many cells have been selected. Just click the OK button to close it.

Then you will see all closest values within the deviation range of the given value are selected as below screenshot shown:

In this Video, the Kutools tab and the Kutools Plus tab are added by Kutools for Excel. If need it, please click here to have a 60-day free trial without limitation!

Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 80% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    farolito · 6 months ago
    im using that formula in finding closest date, it is working.but i want to add condition: closest date that is less than 30 days of the current date (today).it is possible?
    Anyone can help please?thank you
    • To post as a guest, your comment is unpublished.
      kellytte · 5 months ago
      Hi farolito,
      How about changing the value you will compare with to =TODAY() in Cell D1?
  • To post as a guest, your comment is unpublished.
    Liam Ward · 2 years ago

    I can get it to work, amazing, BUT not when I input '1' as my 'match_type', instead of the '0' that you used. I want to return values less than or equal to, not just closest to +/-.

    If I enter 1 instead of 0, it doesn't work.

    Thoughts on why this might be?
  • To post as a guest, your comment is unpublished.
    RaymB · 3 years ago
    Great formula -thank you-just a quick question. Anyone know how to highlight the cell that is closest in the match so in long lists it is easy to find??
    • To post as a guest, your comment is unpublished.
      Phil1982 · 3 years ago
      If you have the row number from the formula above then you could set a conditional formatting rule on the search array to highlight a cell if it lies on that row.
  • To post as a guest, your comment is unpublished.
    Katri · 3 years ago
    It does not work for me! Excel says that there is an error :(
  • To post as a guest, your comment is unpublished.
    Seymour · 3 years ago
    My bad
    This will look for all nearest date to today in column d