Closed Thread
Results 1 to 3 of 3

Finding Unique date and time between two spreadsheets

  1. #1
    Registered User
    Join Date
    12-15-2009
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Finding Unique date and time between two spreadsheets

    Hello,

    Thanks in advance for feedback. I am new to vba, so please be patient if the question seems elementary.

    Every two weeks I get an updated spreadsheet that contains appointment dates and times of people coming in to see a doctor. The problem is that I may get duplicates when I get the next list of new appointments two weeks later. I may have as may as 100 patients one week and 200 patients the next.

    So my question is:

    How do I compare the previous two weeks spreadsheet with the current two week spreadsheet and find the most current appointment date and time for a particular patient and have only that row populated into a third spreadsheet. I have a unique medical number for each of the patients.

    The format of the appt dt is : 11/23/2009 8:30:00 AM
    /*
    appt dt mrn lastname firstname Middle exname dateofbirth patient-address1 patient-address2 patient-city patient-state patient-zipcode patientphone patientencounters-primaryprovidername
    */

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Finding Unique date and time between two spreadsheets

    do you really need code to do this? i'd just paste the new one under the old one
    sortsheet by by date descending then on my other sheet id use a vlookuporindex/match depending on layout against the patients unique number as either will return the first found ie the row with newest date
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    12-15-2009
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Finding Unique date and time between two spreadsheets

    Hello,

    Thanks for the feedback. This is a continuous update and it started a month ago. So far I have two spreadsheets. But as the years continue....

    I do not want duplicates to appear from the previous two weeks in the current two weeks.

    Maybe if I give an example, it would show what I was thinking:

    (first two weeks)
    appt dt mrn lastname
    11/23/2009 8:30 777777 bryant
    11/23/2009 8:45 698986 green
    11/23/2009 9:00 589986 gradey
    11/30/2009 8:44 777771 john
    11/30/2009 8:45 699986 you
    11/30/2009 9:00 589996 reb

    (next two weeks)
    appt dt mrn lastname
    12/7/2009 8:30 447777 thomas
    12/23/2009 8:45 698746 greet
    12/7/2009 9:00 589986 gray
    12/30/2009 8:44 777771 john
    11/30/2009 8:45 699986 you
    11/30/2009 9:00 589996 reb

    How do I get it so that it only shows the first four rows in my example above of "next two weeks".

    Also I am not sure how to get them to automatically be able to compare the two spreadsheets of the two week interval. Right now I was thinking of having them go into the macro and run the Macro name. Is there an easier way to do this?

Closed 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