+ Reply to Thread
Results 1 to 13 of 13

total and average patient counts through admit/discharge dates

  1. #1
    Registered User
    Join Date
    04-24-2024
    Location
    San Francisco
    MS-Off Ver
    Excel 2016
    Posts
    5

    total and average patient counts through admit/discharge dates

    Good morning,
    I've found some similar solutions to this problem, but could use a bit of help still. I have 900+ admit dates paired with discharge dates, covering 2018-present. Some discharge dates are blank, due to the patient still being in our system. I'm trying to calculate the total number of patients we had in every month (January 2019 through present), as well as how many we averaged that month. By average: if we had 100 patients for the entire month, but only 50 for half the month, the average for the month would be 125 and the total would be 150.

    I appreciate any assistance.

    Here is a sample of what I'm trying to do:
    Admit Date Discharge Date Month Total Average
    01/01/2018 01/03/2018 Jan-19
    01/11/2018 01/26/2018 Feb-19
    01/05/2018 02/05/2018 Mar-19
    01/22/2018 02/17/2018 Apr-19
    01/17/2018 03/24/2018 May-19
    01/24/2018 03/27/2018 Jun-19
    01/04/2018 04/04/2018 Jul-19
    01/02/2018 07/03/2018 Aug-19
    01/16/2018 07/19/2018 Sep-19
    01/02/2018 08/14/2018 Oct-19
    01/16/2018 08/14/2018 Nov-19
    01/25/2018 10/21/2018 Dec-19
    01/04/2019 01/05/2019 Jan-20
    12/05/2018 01/20/2019 Feb-20
    07/25/2018 01/22/2019 Mar-20
    10/25/2018 01/22/2019 Apr-20
    09/27/2018 01/25/2019 May-20
    10/05/2018 01/29/2019 Jun-20
    11/01/2018 01/30/2019 Jul-20
    12/28/2018 01/30/2019 Aug-20
    01/14/2019 02/01/2019 Sep-20
    01/23/2019 02/01/2019 Oct-20
    12/05/2018 02/04/2019 Nov-20
    11/07/2018 02/05/2019 Dec-20
    Attached Files Attached Files
    Last edited by crazy8jacky; 04-24-2024 at 11:11 AM. Reason: added sample spreadsheet

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,116

    Re: total and average patient counts through admit/discharge dates

    The first part is easy:

    =SUMPRODUCT((A$2:A$500<EDATE(D2,1))*(B$2:B$500>=D2)*(B$2:B$500<>""))

    copied down. I really do not follow what you want for the average...

    I have filtered out all 56 of those inpatients during January 2019. I have calculated the number of January 2019 days they were in for and taken an average (yellow cell). Is that what you expect to see for every month? Or something else? If so, what?
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,839

    Re: total and average patient counts through admit/discharge dates

    If I understand correctly, I believe the first formula you want might be:

    =SUMPRODUCT((A$2:A$500<EDATE(D2,1))*(A$2:A$500<>"")*((B$2:B$500>=D2)+(B$2:B$500="")))

    because I assume if the Discharge date is blank, that you want to count that person in every month >= their Admit date.
    This part of the formula: (A$2:A$500<>"") was only added if your range is greater than the list of dates. You don't need that part if your range is the same as the list of dates (or better yet, but the dates in an Excel Table).

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,839

    Re: total and average patient counts through admit/discharge dates

    And a guess for your average. in cell G2 and copied down:

    =SUM(MAP($A$2:$A$308,$B$2:$B$308,LAMBDA(x,y,MAX(MIN(y,EOMONTH(E2,0))-MAX(x,E2)+1,0))))/DAY(EOMONTH(E2,0))

    Oh great. After working on this, I now see you are on version 2016. Sorry, this won't work for you. I don't know how you'd do it with 2016.

  5. #5
    Registered User
    Join Date
    04-24-2024
    Location
    San Francisco
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: total and average patient counts through admit/discharge dates

    Quote Originally Posted by Gregb11 View Post
    If I understand correctly, I believe the first formula you want might be:

    =SUMPRODUCT((A$2:A$500<EDATE(D2,1))*(A$2:A$500<>"")*((B$2:B$500>=D2)+(B$2:B$500="")))

    because I assume if the Discharge date is blank, that you want to count that person in every month >= their Admit date.
    This part of the formula: (A$2:A$500<>"") was only added if your range is greater than the list of dates. You don't need that part if your range is the same as the list of dates (or better yet, but the dates in an Excel Table).
    This formula works for me, thank you! I did adjust the A$500 to A$909, as I technically have 909 lines at this time, but it will slowly add more. If you have thoughts on how to do the average with excel 2016, I would appreciate it.

    Quote Originally Posted by Glenn Kennedy View Post
    I really do not follow what you want for the average...
    I mean to say that for an individual who only occupies a bed for 15 out of a 30 day month (such as April), I want to count that as a 0.5 bed, as that bed was only occupied for half of the month. In a 100 bed facility, I want to know how many unique patients we treated (total count), as well as overall what percentage we kept all beds filled (average count). This is to help me track, as I see us brining in many patients, but I'm concerned they are not staying for as long as they should/need.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,116

    Re: total and average patient counts through admit/discharge dates

    Was my suggestion any use for the first part?

  7. #7
    Registered User
    Join Date
    04-24-2024
    Location
    San Francisco
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: total and average patient counts through admit/discharge dates

    Glenn Kennedy, your formula did work for most of the months, but did not take into account clients who do not yet have a discharge date (it's blank as they are still in my system). To be fair, I forgot to include some of those in my sample spreadsheet.

    Thank you

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,116

    Re: total and average patient counts through admit/discharge dates

    Odd. I thought I had checked that. Thanks for letting me know. It's very disheartening to be ignored when you've gone out of your way to help someone. On the road for a fewvhours and will look again later.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,116

    Re: total and average patient counts through admit/discharge dates

    1. I contend that my formula was working perfectly. Refer to the yellow cells at the end of the data. They are the 8 that count towards the 8 recorded in E25. Delete the values in RED, to indicate that the patients are still there. The value in E25 alters to 4. So what's wrong with that? Note also that the value in F25 changes too.. it falls sharply showing that the blank exit dates are not counted. Please SHOW me where this formula DOES NOT work.

    2. For part 2, I created two Named ranges (CTRL-F3 to view/edit), called in and out. Here is one of them:

    =INDEX(Sheet1!$A:$A,AGGREGATE(15,6,ROW(Sheet1!$A$2:$A$500)/(((Sheet1!$A$2:$A$500<EDATE(Sheet1!$D2,1))*(Sheet1!$B$2:$B$500>=Sheet1!$D2)*(Sheet1!$B$2:$B$500<>""))=1),ROW(INDIRECT("1:"&Sheet1!$E2))))

    That's In, Out is similar. Adjust teh bits in red as needed.

    I then used this formula in F2, copied down, to calculate average occupancy on the basis that in on the 4th out on the 5th counts as 1.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-24-2024
    Location
    San Francisco
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: total and average patient counts through admit/discharge dates

    Hi Glenn,
    Thank you for your assistance. Is it possible your formula does not work for me because I'm using an older version of Excel (2016)? When I download the spreadsheet you attached, it still does not work for me. At first all the numbers appear accurate, but as soon as I edit anything then the formula no longer works correctly. For example, the "average" column all reads as 100 now.

    All that said, I do appreciate you helping me out. Thank you

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,116

    Re: total and average patient counts through admit/discharge dates

    Try entering it as an array formula, using CTRL-SHIFT-ENTER before dragging it down. when you open the file, are there {} around the formula?? If so, they almost certainly do need to be array entered.

    Did the second part work as hoped? If not, try entering IT as an array formula. You very quickly forget which formulae need to be entered as arrays, once you switch to O365.

  12. #12
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,839

    Re: total and average patient counts through admit/discharge dates

    @Glenn,
    Delete the values in RED, to indicate that the patients are still there. The value in E25 alters to 4. So what's wrong with that?
    I may have misinterpreted it, but that's where I thought the issue was. If there is no discharge date, they SHOULD be counted as being there. So if you delete the discharge date in your example, the number shouldn't change because their still considered there.

  13. #13
    Registered User
    Join Date
    04-24-2024
    Location
    San Francisco
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: total and average patient counts through admit/discharge dates

    Quote Originally Posted by Glenn Kennedy View Post

    If not, try entering IT as an array formula. You very quickly forget which formulae need to be entered as arrays, once you switch to O365.
    That seems to be an IT issue for me, no array formula are working on this computer. It appears for now I'm really stuck. Thank you for the feedback thus far, I'll see if I can figure out the excel issue when my IT admin comes back from vacation next week.

+ 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. Replies: 7
    Last Post: 12-20-2022, 05:43 AM
  2. Replies: 11
    Last Post: 09-27-2019, 08:00 AM
  3. Fill cells with discharge dates
    By stephenedwardbennett in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-08-2016, 09:13 AM
  4. Filling cells with discharge dates
    By stephenedwardbennett in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2016, 06:14 AM
  5. Replies: 18
    Last Post: 03-24-2013, 04:20 PM
  6. Manipulating intake & discharge dates, counting between dates
    By lisast in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-02-2013, 03:59 AM
  7. Replies: 2
    Last Post: 12-29-2011, 01:26 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