+ Reply to Thread
Results 1 to 7 of 7

How to pick last appointment date in client list with duplicate clients

  1. #1
    Registered User
    Join Date
    06-28-2012
    Location
    Eureka, CA
    MS-Off Ver
    Excel 2010
    Posts
    14

    How to pick last appointment date in client list with duplicate clients

    I have a spreadsheet filled with the following:

    Column A: Patient ID
    Column B: Last Name
    Column C: First Name
    Column D: Event Date

    Many patients have had multiple appointments. I am trying to determine the last appointment for each patient. Please help. I should add that I am a novice and do not speak VBA language. Thank you.

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: How to pick last appointment date in client list with duplicate clients

    Assuming your data is in A1:D4, type this into cell E1:
    =MAX((A1=$A$1:$A$4)*($D$1:$D$4))
    Enter it with Ctrl-Shift-Enter
    Drag that formula down to E4.

    This will create a column which shows the last appointment for the patient on that row.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: How to pick last appointment date in client list with duplicate clients

    Though you have not provided a sample workbook so not aware of your sheet layout, just to give you an idea how you can achieve this, here is an example. You can make the changes in the formula as per your original workbook. Assuming that all your patients have the unique patient id.

    A B C D E F G H I
    1 Patient ID L Name F Name Event Date Patient ID L Name F Name Event Date
    2 1 A M 01/09/2014 1 A M 08/09/2014
    3 2 B S 02/09/2014 2 B S 07/09/2014
    4 3 C T 03/09/2014 3 C T 09/09/2014
    5 1 A N 04/09/2014 4 D R 06/09/2014
    6 3 C T 05/09/2014
    7 4 D R 06/09/2014
    8 2 B S 07/09/2014
    9 1 A M 08/09/2014
    10 3 C T 09/09/2014

    Formulas used are as below.
    In G2
    Please Login or Register  to view this content.
    and then copy right to H2 and then down to row 5.

    In I2
    Please Login or Register  to view this content.
    and then copy down.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    06-28-2012
    Location
    Eureka, CA
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to pick last appointment date in client list with duplicate clients

    I have 232 rows including the headers, in which your example perfectly matches my data--other than the number of rows. The patients all have unique IDs.
    I changed the formulas to include the 232, so in G2 I have:
    =INDEX(B$2:B$232, MATCH($F2, $A$2:$A$232,0))
    and I copied right to H and then down to Row 5. My results are : #N/A in each cell G2:H:5.
    In I2 I have:
    =INDEX($D$2:$D$232,MAX(INDEX(($A$2:$A$232=F2)*(ROW($A$2:$A$232)-ROW($A$2)+1),0)))
    and I copied down to Row 5. I get dates that match the dates in Column D, even though one of these four patients is a duplicate. That patient shows up with both dates in two separate coumns.
    I also know that once this is working I should copy all the way down to the last row.
    My questions are:
    Do my formulas look correct?
    Should I be formatting cells G2: I5?
    If this were to run correctly, I assume that I would delete Column D and Remove duplicates. I am in Excel 2010 in case that matters.
    Thank you for your help! It is appreciated.

  5. #5
    Registered User
    Join Date
    06-28-2012
    Location
    Eureka, CA
    MS-Off Ver
    Excel 2010
    Posts
    14

    Red face Re: How to pick last appointment date in client list with duplicate clients

    Totally worked! Thank you!

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: How to pick last appointment date in client list with duplicate clients

    Glad to know that.
    If that takes care of your question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.
    Moreover you may also click on * (star) to Add Reputation if the solution provided helped you. This is another way to say thanks.

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: How to pick last appointment date in client list with duplicate clients

    One more suggestion. As you said you have 232 rows of data and col. A contains the patient ids and col. A will have repetition of patient ids as there may be more than one appointment for a particular patient. To get the summary in cols. F, G, H and I, you need to input the patients ids in col. F starting from F2. And for that you can use another formula to get the unique patient ids in col. F, so that you don't need to input them manually.
    To get the unique patient ids in col. F, you may try this Array Formula in F2. Since this is an array formula so you need to confirm it with Ctrl+Shift+Enter instead of just Enter which you normally do in case of a regular excel formula. i.e. after typing the formula in the formula cell, don't press Enter but hold down the Ctrl+Shift keys together and then hit Enter. When you enter a formula as an array formula, you will notice in the formula bar that the formula gets surrounded by the Curly Brackets like {= Formula here }and if you don't see the curly brackets in the formula bar, select the formula cell and then press F2 (Function Key), hold down the Ctrl+Shift and then hit Enter to correctly enter that formula as an array formula.

    In F2
    Please Login or Register  to view this content.
    Enter this formula with Ctrl+Shift+Enter and then copy it down until you get the blank cells. (The best way is copy the above formula, go to your sheet and select F2 and then press Function Key F2, now paste the formula by Ctrl + V, hold down the Ctrl+Shift and then hit Enter and hold the fill handle and copy the formula down the rows.)

    Hope this helps.

+ 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. Client Churn: percentage of new clients by year
    By Ticktockman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-08-2014, 06:28 PM
  2. Replies: 8
    Last Post: 03-14-2014, 02:46 PM
  3. Appointment Calendar that automatically syncs with Excel Client Database
    By Earthsong in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-08-2014, 08:13 PM
  4. [SOLVED] List clients in a chart by date on course
    By john dalton in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-18-2013, 03:08 AM
  5. Determining last date seen from list with clients seen multiple times
    By AllisonT in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-24-2013, 08:49 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