+ Reply to Thread
Results 1 to 2 of 2

Joining Tables Based on Common ID

  1. #1
    Registered User
    Join Date
    12-11-2018
    Location
    Washington, US
    MS-Off Ver
    2017
    Posts
    1

    Joining Tables Based on Common ID

    Question: Each Patient ID represents one patient. There are multiple visit dates and prescription dates for each patient, in separate tables. I want to populate the “closest prescription date” column in Table 1 with the prescription date for that patient that is closest to each date. I also want to be able to do 2nd closest, 3rd closest, etc.
    Table 1
    Patient ID Visit Date Closest Prescription Fill Date 2nd closest prescription fill date 3rd closest prescription fill date
    1 1/1/2015
    1 9/15/2015
    2 1/5/2015
    3 3/6/2015
    3 11/16/2015
    4 9/5/2015
    4 9/4/2015
    5 11/7/2015
    5 7/4/2015

    Table 2
    Patient ID Prescription Fill Date
    1 1/6/2015
    1 12/8/2015
    2 11/8/2015
    2 8/18/2015
    2 9/9/2015
    3 6/17/2015
    3 9/8/2015
    4 3/5/2015

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Joining Tables Based on Common ID

    Can you attach a sample workbook showing your mocked-up results for that sample.

    Go Advanced -> Manage Attachments -> Upload

+ 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. Align two tables by row based on common column
    By jdaich in forum Excel General
    Replies: 3
    Last Post: 12-09-2017, 09:17 AM
  2. [SOLVED] Joining two tables which have a common reference
    By mr-jojo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2015, 11:07 AM
  3. Joining two tables using a common column
    By hgteros in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-18-2013, 08:04 PM
  4. [SOLVED] Help Joining 3 worksheets using common fields using IF & VLOOKUP formula
    By Jennsy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2012, 11:44 AM
  5. Comparing two spreadsheets joining on a common column
    By plasma800 in forum Excel General
    Replies: 0
    Last Post: 06-29-2010, 04:44 PM
  6. Joining two datasheets on common ID...
    By RynMan in forum Excel General
    Replies: 2
    Last Post: 01-28-2009, 03:18 AM
  7. joining two spreadsheets on common column
    By shorty68 in forum Excel General
    Replies: 0
    Last Post: 02-07-2005, 07:13 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