+ Reply to Thread
Results 1 to 4 of 4

Finding Nearest value using Index/Match

  1. #1
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Finding Nearest value using Index/Match

    Hi All,

    I am trying to find the nearest match based on two criteria.

    Formula works fine when looking for perfect match, but fails when looking for nearest match.

    Not sure what I am doing wrong.

    Please see the attached spreadsheet.

    Any guidance is most appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Finding Nearest value using Index/Match

    Please try

    =MOD(MIN(IF(INDEX(I5#,,1)=N8,IF(INDEX(I5#,,3)=P8,ABS(INDEX(I5#,,2)-O8)+L5#))),1)
    or
    =INDEX(SORTBY(L5#,IF(INDEX(I5#,,1)=N8,IF(INDEX(I5#,,3)=P8,ABS(INDEX(I5#,,2)-O8)))),1)
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Re: Finding Nearest value using Index/Match

    Hi Bo_Ry,

    WOW!!!!!!!!

    what you have put together here is nothing like what I would have done in 100 years. That is superb mate. :-)

    I am astounded at your knowledge!!!

    Thanks

  4. #4
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Re: Finding Nearest value using Index/Match

    Hi Bo-Ry,

    the formula you created to find the nearest match also works for finding the exact match.

    This is really great, because I can reduce the coding associated with a linear regression that relies on these exact and nearest matches.

    Perfect......

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] INDEX/MATCH generates incorrect result by referencng nearest cell if match not found
    By aglawrence in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-29-2017, 08:59 AM
  2. Index match with multiple conditions and nearest function
    By Suzann in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 04-05-2016, 04:16 AM
  3. Match, Index to nearest number query
    By jonhigson in forum Excel General
    Replies: 1
    Last Post: 09-18-2014, 05:51 AM
  4. Index and Match where one of the lookups needs to be nearest to
    By Alkaline198 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-21-2014, 04:35 PM
  5. [SOLVED] INDEX MATCH - Find Nearest Value
    By JonesZoid in forum Excel General
    Replies: 5
    Last Post: 07-23-2012, 05:48 AM
  6. Index Match using nearest values
    By Nebuchanezer in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-11-2007, 04:22 AM
  7. [SOLVED] Lookup nearest value (Index & Match)
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-06-2006, 12:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1