+ Reply to Thread
Results 1 to 4 of 4

Index Match with multiple criteria - 1 exact, 1 approximate

  1. #1
    Registered User
    Join Date
    08-30-2017
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    2

    Index Match with multiple criteria - 1 exact, 1 approximate

    I have 2 tables where I am trying to get a closest match without writing a lengthy macro.

    Table 1 has columns: ID, Distance, Latitude, Longitude
    Table 2 has columns: ID, Distance

    I'm trying to add latitude and longitude to the second table but with this complication: the distances don't exactly match. But the ID's should.

    So I want to get the latitude and longitude from table 1 for EXACT ID match, and approximate Distance match. I've been playing around with different formulas from different forums including this one, but none are giving me what I want.

    Any advice would be very appreciated.

    I've attached a sample file with data changed. Table1 has ID, Distance, Latitude and Longitude. Table2 has same ID's, different distances, and needs closest latitude and longitude from Table1.
    A 3150 25.156234 110.235375
    A 3200 25.157234 110.236585
    A 3250 25.158234 110.237795
    A 3300 25.159234 110.239005

    A 3120
    A 3240

    the top group there would be table 1, and the bottom group would be table 2. So I would want to grab the latitudes from row 1 for the first one in table 2, and then row 3 for entry #2, if that makes sense.
    Attached Files Attached Files
    Last edited by sittinontop; 08-30-2017 at 04:54 PM. Reason: Adding attachment

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index Match with multiple criteria - 1 exact, 1 approximate

    Hi, sittin, welcome to Excel Forum! A small sample workbook (NOT a picture) helps us to solve your problem quickly and accurately.
    Remove any sensitive or extraneous info, we just need some “realistic” data for testing purposes.
    Please include examples of any variations the code or formula must address.
    Also, PLEASE simulate some results to demonstrate what you want.

    To attach a workbook:
    Click Edit Post (or just start a new reply.)
    Click Go Advanced
    Scroll down to Manage Attachments and click.
    Now just Browse for your file, then click Upload. Simple!

    ps. Lat/Long define ONE point. Distance from...?
    Last edited by leelnich; 08-30-2017 at 04:26 PM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Registered User
    Join Date
    08-30-2017
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    2

    Re: Index Match with multiple criteria - 1 exact, 1 approximate

    Added an example file and some more detail above.

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Index Match with multiple criteria - 1 exact, 1 approximate

    Latitude (Table2!D3):
    Please Login or Register  to view this content.
    Longitude (Table2!E3):
    Please Login or Register  to view this content.
    You did not specify what to return if no "best fit" is available. These formulae show the #DIV/0! error if that happens, but they could be wrapped in an IFERROR() function to control the output in that scenario.
    Attached Files Attached Files
    Last edited by leelnich; 08-30-2017 at 05:49 PM.

+ 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. Replies: 10
    Last Post: 10-26-2021, 05:36 AM
  2. [SOLVED] index match - 2 criteria (Date & String) one needs to be less than the other exact
    By timhuls1 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-04-2017, 08:34 AM
  3. [SOLVED] index match with approximate and exact lookups
    By jhuvba in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-10-2016, 12:56 PM
  4. [SOLVED] Index(Match with 2 criteria; 1 exact and 1 approx
    By JuJuBe in forum Excel General
    Replies: 2
    Last Post: 06-09-2016, 04:27 PM
  5. [SOLVED] vba to replace string from exact match list by searching approximate value
    By johnlara in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2015, 10:12 AM
  6. [SOLVED] index match - 2 criteria, one approximate
    By abhishek007 in forum Excel General
    Replies: 11
    Last Post: 04-11-2015, 05:46 PM
  7. Index(Match) with 2 criteria, one of which is approximate
    By mikeronni in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-12-2014, 01:38 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