+ Reply to Thread
Results 1 to 9 of 9

waiting times for different conditions

  1. #1
    Registered User
    Join Date
    06-29-2011
    Location
    sheffield
    MS-Off Ver
    Excel 2003
    Posts
    23

    waiting times for different conditions

    Hi there,

    I am creating a database for calculating waiting times for patients. I would like to separate out inpatient (IP) and outpatient (OP) waiting times and calculate the times based on different conditions. I have attached an example database.

    The different conditions are:

    1. If the patient is an IP (column B) and has both a referral date (column C) and an appointment date (column E), then their waiting time (column F) is the time between the 2 dates (see Robin Hood). If the IP has a referral date, but not yet an appointment date then the waiting time is from the referral date to present time (Jon Carrot). If the IP does not have a referral date or an appt date then I would like their waiting time cell to remain blank (Susie Bone). And finally, in the IP waiting time column I only want waiting times for the IP's, for any OP's I would like the cells in this column to remain blank.

    2. If the patient is an OP and has both an opt in date (column D) and an appointment date, then their waiting time is the time between the 2 dates (Jane Kane). If the OP has an opt in date, but not yet an appointment date then the waiting time is from the referral date to present time (Des Line) If the OP does not have an opt in date or an appt date then I would like their waiting time cell to remain blank. (Chip Smith). And finally, in the OP waiting time column I only want waiting times for the OP's, for any IP's I would like the cells in this column to remain blank.

    Thanks very much

    Sophy
    Attached Files Attached Files
    Last edited by sophy_1402; 08-09-2011 at 08:56 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: waiting times for different conditions

    Try these formulas. In F2 and then copied down:

    =IF($B2="IP", CHOOSE(COUNT($C2:$E2)+1, "", TODAY()-$C2, $E2-$C2), "")


    In G2 and then copied down:

    =IF($B2="OP", CHOOSE(COUNT($C2:$E2)+1, "", "", TODAY()-$C2, $E2-$D2), "")
    Last edited by JBeaucaire; 08-03-2011 at 11:35 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: waiting times for different conditions

    Here is another method,

    See Attachment
    Attached Files Attached Files
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

  4. #4
    Registered User
    Join Date
    06-29-2011
    Location
    sheffield
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: waiting times for different conditions

    That's great, thanks very much. The formula's are working well, there are a couple of things I would like to add in and wonder if you could help.
    Firstly when a patient (either IP or OP) does not have a referral date, opt in or appt yet the waiting time is coming up 0. I would like this to remain blank so the average waiting times are not miscalculated. Also, is it at all possible to flag up any patients who do not have an appt date yet (i.e. those who are on the waiting list). Perhaps in a differerent colour until they are given an appt date.

    thanks so much for your help

    Sophy

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: waiting times for different conditions

    I edited formulas in post #2 to take out the zeros.... you could've probably spotted that.

    You can use conditional formatting to change the color of one cell based on the contents or lack of contents in another cell.

  6. #6
    Registered User
    Join Date
    06-29-2011
    Location
    sheffield
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: waiting times for different conditions

    Thanks thats great, one final things where do I add the /7 if I want the waiting times to be in weeks instead of days. Thanks alot fo your help!

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: waiting times for different conditions

    Each of the small formulas has to have that added individually:

    F2: =IF($B2="IP", CHOOSE(COUNT($C2:$E2)+1, "", (TODAY()-$C2)/7, ($E2-$C2)/7), "")
    G2: =IF($B2="OP", CHOOSE(COUNT($C2:$E2)+1, "", "", (TODAY()-$C2)/7, ($E2-$D2)/7), "")

  8. #8
    Registered User
    Join Date
    06-29-2011
    Location
    sheffield
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: waiting times for different conditions

    Thanks very much for all of your help.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: waiting times for different conditions

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to 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