Skip to main content
 

How to find closest or nearest value (number or text string) in Excel?

Author: Xiaoyang Last Modified: 2024-08-26

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 number with array formula

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:

Select a blank cell, and enter below formula, and press the Ctrl + Shift + Enter keys together.

=INDEX(B3:B22,MATCH(MIN(ABS(B3:B22-E2)),ABS(B3:B22-E2),0))

Note: In this array formula of {=INDEX(B3:B22,MATCH(MIN(ABS(B3:B22-E2)),ABS(B3:B22-E2),0))},

  • B3:B22 is the range that you want to find the specific value
  • E2 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

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

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 offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Enhanced with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

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,
(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:
set options in the Select Specific Cells dialog box

3. Click the Ok button to apply this utility. Then a dialog box comes out and shows you how many cells have been selected. And you will see all closest values within the deviation range of the given value are selected as below screenshot shown:
all closest values of the given value are selected


Find the closest or nearest text string with a handy tool

If you have Kutools for Excel installed, you can apply its Fuzzy Find feature to find out closest text strings from a given range easily in Excel. Please do as follows:

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Enhanced with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Click Kutools > Find > Fuzzy Lookup to enable the Fuzzy Lookup pane in your workbook.

2. In the Fuzzy Lookup pane, please configure as follows;
(1) Check the Specified option, and select the range where you will look for closest text strings;
(2) Check the Find by specified text option;
(3) Go to the Text box, and type the specified text whose closest text strings you will find;
(4) In the Maximum number of different characters box, please type a number. In my case, I type 1;
(5) In The cell string length is at least box, please type a number. In my case, I type 5;
set options in the Fuzzy Lookup pane

3. Click the Find button.

Now expand the search results, and you will see all closest text strings are listing in bulk. See screenshot:
all closest text strings are listing in bulk


Demo: select all closest values in deviation range of given value

 

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!