+ Reply to Thread
Results 1 to 4 of 4

Find earliest date based on specific criteria in other columns

  1. #1
    Registered User
    Join Date
    03-14-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Find earliest date based on specific criteria in other columns

    For a patient database, I would like to be able to pick the earliest date (occasion of service date, column B) for a certain individual (client ID, column A) for when they presented with a specific condition (presenting condition, column C). See attached spreadsheet.

    For example, I would like to pick the earliest date when an individual presented for "CONTACT TB". I would also like to be able to test for different combinations for presenting conditions, e.g. earliest date when somebody presented with either "CONTACT TB" or "CHEMOPROPHYLAXIS".

    Additional challenge: Not every individual has the same number of occasion of service dates and some fields contain no information. Also, not everybody in the database will have the presenting condition I'm looking for.

    I'm just an Excel user, but don't know much about programming. I think that maybe a Pivot table could help to solve the problem. Although I can get a good overview in a Pivot Table with "Client ID" and "OOS data" as row labels, "Presenting condition" as column label and "count of presenting condition" in values, I don't know how to automatically always pick the earliest date for a certain condition.

    Any help with this problem would be greatly appreciated.

    Cheers,
    cat2000
    Attached Files Attached Files
    Last edited by cat2000; 07-30-2011 at 11:27 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: Find earliest date based on specific criteria in other columns

    Look at sheet 3. You can use the patient filter and/or the condition filter to get your results. I put the patient in the Page area and the other two fields in the row area. Use the drop down arrows to filter.

    Alan
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    03-14-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Find earliest date based on specific criteria in other columns

    Thanks for your help, Alan.

    The problem is that I still have to manually select the earliest date for a certain medical condition. What I'm looking for is a way to automatically extract the information (earliest date for specific condition) into a new column that I then can link for a specific ID with the rest of my dataset.

    Claudia
    Last edited by cat2000; 07-30-2011 at 11:24 AM.

  4. #4
    Registered User
    Join Date
    03-14-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Find earliest date based on specific criteria in other columns

    I found a solution using the MIN IF function that allows to pick the earliest date taking into account variables from other columns. It's outlined in the attachment.

    Thanks everybody.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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