+ Reply to Thread
Results 1 to 5 of 5

Find Closet Match in a table

  1. #1
    Registered User
    Join Date
    04-20-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Find Closet Match in a table

    Hi everyone,

    I was wondering if someone could help me with a basic problem. I have a table that I am trying to find the closest match and return that value.

    728 -8.1
    791 -4.7
    698 -9.6
    700 -10.3
    806 -2.5
    810 -9.2

    So if I had a search value of 730 then the result would be -8.1.

    Many thanks,

    Matt

  2. #2
    Registered User
    Join Date
    04-20-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Find Closet Match in a table

    Need to add if the search value is +/-20 outside the values in Column A then the result = 0,

    ie 708 = 0
    710 = -8.1
    820 = -9.2
    830 = 0


    Thanks

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Find Closet Match in a table

    Does closest mean less than or equal to, greater than or equal to, or closest +/-?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find Closet Match in a table

    With your data in cells A2:B7 and the search value (730) in C1 I used this formula:

    =INDEX(B:B,MAX(INDEX(ROW($A$2:$A$7)*(ABS($A$2:$A$7-C2)=MIN(INDEX(ABS($A$2:$A$7-C2),0))),)))

  5. #5
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Find Closet Match in a table

    Hi You can use vlookup but your data should be sort
    Attached Files Attached Files
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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