Skip to main content

Lookup closest match

To look for the closest match of a lookup value in a numeric dataset in Excel, you can use the INDEX, MATCH, ABS and MIN functions together.

lookup closest match 1

How to find the closest match in Excel?

To know which salesman made the closest sales to the target of $20,000 as shown above, a formula combines the INDEX, MATCH, ABS and MIN functions will help you in this way: The ABS function will turn all the difference values between the sales made by each salesman and the sales target positive, then MIN will find the smallest difference, which means the closet match. Now we can use the MATCH function to locate the position of the closet match and have INDEX to retrieve the value at the corresponding position.

Generic syntax

=INDEX(return_range,MATCH(MIN(ABS(lookup_array-lookup_value)),ABS(lookup_array-lookup_value),0))

√ Note: This is an array formula that requires you to enter with Ctrl + Shift + Enter.

  • return_range: The range where you want the combination formula to return the salesman from. Here refers to the name range.
  • lookup_array: The range of cells with the values to compare with the lookup_value. Here refers to the sales range.
  • lookup_value: The value to compare with to find its closest match. Here refers to the sales target.

To know which salesman made the closest sales to the target of $20,000, please copy or enter the formula below in the cell F5, and press Ctrl + Shift + Enter to get the result:

=INDEX(B5:B10,MATCH(MIN(ABS(C5:C10-20000)),ABS(C5:C10-20000),0))

Or, use a cell reference to make the formula dynamic:

=INDEX(B5:B10,MATCH(MIN(ABS(C5:C10-F4)),ABS(C5:C10-F4),0))

lookup closest match 2

Explanation of the formula

=INDEX(B5:B10,MATCH(MIN(ABS(C5:C10-F4)),ABS(C5:C10-F4),0))

  • ABS(C5:C10-F4): The part C5:C10-F4 will get all the difference values between each sales in the range C5:C10 and the target sales $20,000 in cell F4 in an array like this: {-4322;2451;6931;-1113;6591;-4782}. The ABS function will turn all the negative numbers positive like this: {4322;2451;6931;1113;6591;4782}.
  • MIN(ABS(C5:C10-F4)) = MIN({4322;2451;6931;1113;6591;4782}): The MIN function will find the smallest number from the array {4322;2451;6931;1113;6591;4782}, which means the smallest difference, or we say the closet match. So the function will return 1113.
  • MATCH(MIN(ABS(C5:C10-F4)),ABS(C5:C10-F4),0) = MATCH(1113,{4322;2451;6931;1113;6591;4782},0): The match_type 0 forces the MATCH function to find the position of the exact number 1113 in the array {4322;2451;6931;1113;6591;4782}. The function will return 4 since the number is at the 4th position.
  • INDEX(B5:B10,MATCH(MIN(ABS(C5:C10-F4)),ABS(C5:C10-F4),0)) = INDEX(B5:B10,4): The INDEX function returns the 4th value in the name range B5:B10, which is Bale.

Related functions

Excel INDEX function

The Excel INDEX function returns the displayed value based on a given position from a range or an array.

Excel MATCH function

The Excel MATCH function searches for a specific value in a range of cells, and returns the relative position of the value.

Excel ABS function

The ABS function returns the absolute value of a number. Negative numbers will be converted to positive with this function, but positive numbers and zero number will be unaffected.


Related Formulas

Lookup Closest Match Value With Multiple Criteria

In some cases, you may need to lookup the closest or approximate match value based on more than one criteria. With the combination of INDEX, MATCH and IF functions, you can quickly get it done in Excel.

Approximate match with INDEX and MATCH

There are times when we need to find approximate matches in Excel to evaluate employees' performance, grade students’ scores, calculate postage based on weight, etc. In this tutorial, we will talk about how to use the INDEX and MATCH functions to retrieve the results we need.

Lookup closest match value with multiple criteria

In some cases, you may need to lookup the closest or approximate match value based on more than one criteria. With the combination of INDEX, MATCH and IF functions, you can quickly get it done in Excel.


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖 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 VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy 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 Columns to Select Same & Different Cells ...
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 Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations