+ Reply to Thread
Results 1 to 48 of 48

Calculate Total Hours each occurrence and Total Days for all occurences

  1. #1
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Calculate Total Hours each occurrence and Total Days for all occurences

    Hello Forum,

    I am a new member and hope to have your help with calculating time in hours and days.

    Attached is my sample data (fictional information), which has several tabs.

    Colour Legend
    Data on worksheet from original source
    Data to pull from Encounter Demographics worksheet to Case Log worksheet (based on "match" of "Encounter Number")
    Derived from formula (added column not on worksheet from original source)

    What I am trying to do:

    During an encounter, a patient may be transferred between different units. Some units are designated "special care" - see tab "Unit List".

    An ICU/Stepdown occurrence begins when patient first arrives in a special care unit and ends when the "Unit Nxt Tsf" is not a special care unit or patient is discharged (see exception for OR's).

    The OR's are not special care units but if patient was in a special care unit BEFORE going to the OR the special care occurrence time continues until patient is transferred to another unit after the OR (may or may not be "special care") or patient is discharged.

    Example 1 - patient in ICU goes to OR, returns to ICU from the OR, is transferred to Stepdown unit, then discharged directly from Stepdown unit. This would constitute one occurrence with the start time being first arrival in ICU and end time being discharge time.
    Example 2 - patient on floor (not a special care unit) goes to ICU, is transferred to Stepdown unit, is transferred to floor, then discharged. Occurrence would start with time patient arrived at ICU from the floor, continue through time in Stepdown, and end when patient transferred to floor again.

    Patients can have multiple ICU/Stepdown occurrences and multiple surgeries during an encounter, and each ICU/Stepdown occurrence can involve transfers between different "special care units" and the OR.

    Need a formula that calculates the number of hours of each continuous ICU/Stepdown occurrence, listing them chronologically (up to 7 occurrences), and also calculate the total number of days in ICU/Stepdown, with the total days being shown on the case log.

    I know it's the holiday season, but if anyone can help me solve this before Monday, I would very much appreciate it.

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi CARD17 and welcome to the forum.

    That you want the minutes and days part is clear. I am a little confused about the description preceding that part.
    If I am understanding the assignment correctly this should take care of the formula in column P.

    =IF(AND(COUNTIF($A$2:A2,A2)=COUNTIF(A:A,A2),VLOOKUP(M2,'Unit List'!$A$2:$B$9,2,FALSE)="No"),"End ICU Occurrence","Continued")

    Still working on the minutes / days part.
    Last edited by FlameRetired; 12-28-2016 at 12:51 AM.
    Dave

  3. #3
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi FlameRetired and thanks for taking a look at this so quickly.

    I've tried entering the formula you suggested in column P (on the Encounter Demographics worksheet), but it doesn't indicate "End ICU Occurrence" at any time for the first encounter number. For the encounter, the patient's final transfer was to the stepdown unit - where they stayed until the Discharge Date (as there were no further transfers listed). When this happens, I was thinking the formula would return "End ICU Occurrence" rather than "Continued".

    The descriptive part about the colour coding is just there as a reference - I didn't know if it mattered where the information originated - so I gave as much information as I could.

    If there is anything else you would like clarified, please let me know; and thank you again for your help with this. Excel is wonderful, but I'm still learning the more advanced formulas and functions, and very glad to have help.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    I've tried entering the formula you suggested in column P (on the Encounter Demographics worksheet), but it doesn't indicate "End ICU Occurrence" at any time for the first encounter number. For the encounter, the patient's final transfer was to the stepdown unit - where they stayed until the Discharge Date (as there were no further transfers listed).
    My logic derailed on the NEXT TSF UNIT part (column M of 'Encounter Demographics').

    See if this formula does what you expect. If 'OR 1' or 'OR 2' happen to be in cell M5 see what the output is.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 12-28-2016 at 03:41 PM. Reason: additional detail

  5. #5
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi,

    I copied the new formula into column P on the Encounters Demographics sheet, which now shows "End ICU Occurrence" in cell M5 as it should. But, now the second and third encounters both show as "Continued" rather than showing "End ICU Occurrence" as they did with the previous formula. Do I need to combine the old and new formulas?

    Next, once I have the "End ICU Occurrence" in column P, can a formula in column Q somehow calculate the ICU minutes (i.e. if column P has End ICU Occurrence, use the occurrence end date time from column K and subtract the occurrence start date time from column J - going up to the row where that occurrence began?

    I'm not sure I'm explaining it clearly, but thrilled that you're helping me with this.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Next, once I have the "End ICU Occurrence" in column P, can a formula in column Q somehow calculate the ICU minutes (i.e. if column P has End ICU Occurrence, use the occurrence end date time from column K and subtract the occurrence start date time from column J - going up to the row where that occurrence began?
    I will not be confident in my minutes and days calculations until CONTINUE OR END ICU/STEPDOWN OCCURENCE ON NEXT TSF (column P) is resolved. They appear to relate.

    Let's try this in steps.

    The following formula will always return 'End ICU Occurrence' in the row corresponding to the last ENCOUNTER NUMBER in a series. It makes no references to the NEXT TSF UNIT (column M). Let's tackle that part later.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    When you try just this formula what needs to change?

  7. #7
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    That works. I think there is only one other scenario to address in that column, which is when a patient has more than one ICU/Stepdown occurrence - and I just realized my sample data doesn't include that. For example, if the patient was transferred to the floor (A103) and stayed there for a week, THEN went back to ICU for 3 days, I would need two separate ICU/Stepdown occurrences within that one "encounter", so there would be two rows with "End ICU Occurrence" for the same patient within the same encounter. And I need the total minutes/days for each occurrence, and a total days for the encounter (units have to be whole numbers and rounded up so any part of 24 hours counts as 1 day).

    Would it help if I create a larger sample data - say 50 patients?

    Let me know.. and thank you so much for your time on this.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Would it help if I create a larger sample data - say 50 patients?
    Yes. I was about to suggest that. Please include several of those complex variations you cited. If you would include explanation(s) of the logic behind the outputs that could be of help.

  9. #9
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Okay. I have to head out for an hour or two, but will upload larger sample data later tonight. I will include the explanations of logic as requested.

  10. #10
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    I'm back but I keep getting logged out when I try to post...

  11. #11
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    But it worked that time, so ... I'm almost done with the larger sample data that includes every scenario I can think of. What is the limit on file size to upload here?

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    I believe it's 1 MB. Is the new file that large?

  13. #13
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi Flame Retired, I'm going to upload what I have. I've changed the column headings to include extra info (i.e., desired result, etc). Where I indicate minutes/days results, this is just by point and click for each, so need a formula that works for all. Red/Green indicate where current formula not giving desired result. Here goes...

  14. #14
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Message says the larger sample file exceeds the limit of 1,000 (file is 1,200)... can I upload a zip file?

  15. #15
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi... now the file is small enough to upload... hope this helps.
    Attached Files Attached Files

  16. #16
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    I've had to guess a bit. Try this formula in column P. It returns the desired results in your workbook.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If this works with the rest of your real data I'm ready to move on with the Minutes / days parts.

  17. #17
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Quick question on the minutes calculations. In column R you have this formula in R2.

    =ROUNDUP((K2-J2)*1440,1)

    Due to formatting R2 shows 1907. Though R2 shows 1907 the value is really 1906.9. If you aren't aware of it formatting has no effect upon the value. Formatting is cosmetic only. Excel still "sees" 1906.9.

    Which figure do you want to use? If 1907 is the desired value there will need to be an additional rounding step.

  18. #18
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    IT WORKED !!! Wow, I don't know what to say! This is wonderful. Let me know if there is anything else I can do to help with the minutes/days part. Did you have a chance to see if my attempt was on the right track? I'm sure whatever you come up with will be great and I look forward to hearing back from you.

  19. #19
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    For the minutes in column R, I was looking for it to be rounded up to the next minute if any decimal (or it can be rounded to the next whole hour) for each "End ICU Occurrence". Then, for the days, rounded up so 1.3 days would have to show as 2 days. And for the total ICU days for the whole encounter, need the total days of the ICU occurrences. Example - if one occurrence is 2 days and second occurrence is 3 days, then total days for that encounter would be 5 days.

    Does that help?

  20. #20
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Quote Originally Posted by CARD17 View Post
    Message says the larger sample file exceeds the limit of 1,000 (file is 1,200)... can I upload a zip file?
    Yes I missed your question earlier. You can upload a zip file. I don't know what the file size limits are for those. Give it a try if you think it will help.

  21. #21
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    FYI: ZIP file max is 9.77 MB.

  22. #22
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Then, for the days, rounded up so 1.3 days would have to show as 2 days. And for the total ICU days for the whole encounter, need the total days of the ICU occurrences. Example - if one occurrence is 2 days and second occurrence is 3 days, then total days for that encounter would be 5 days.
    To clarify: are you rounding each occurrence up before summing, or are you summing and then rounding the total up?

  23. #23
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Quote Originally Posted by JohnTopley View Post
    FYI: ZIP file max is 9.77 MB.
    Thank you, sir. That is larger than I would have expected.

  24. #24
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    The days of each occurrence would need to be a whole number, then the total of occurrences during the encounter would be the sum of the whole number of each occurrence.

    Example, if first occurrence was 10 hours, it would be rounded to 1 whole day; if second occurrence was 36 hours, it would be rounded to 2 whole days. So the total ICU days for the encounter would be 1 + 2 = 3 days.

    NOT -10 + 36 = 46 hours would round to 2 days and that's not what I want it to do). Does that make sense?
    Last edited by CARD17; 12-29-2016 at 03:08 PM. Reason: typo

  25. #25
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Actually, you have me wondering about it now. Can you do a column for each way (just in case I'm wrong and won't be able to confirm it until next week).

  26. #26
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    I'll do my best.

    Additionally: I find it unlikely that I will be able to solve the minutes without a helper column(s). Is this acceptable?

  27. #27
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    As many helper columns as you need is okay with me!

  28. #28
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    On the larger sample data I deleted the Case Log worksheet that was on the original sample. Once all the time elements are working, I have a column on the Case Log (every encounter has only one line) that I need to have a formula that pulls the Total ICU Days for each encounter. I think I can figure that part out with index/match but might need help.

  29. #29
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    The formula you came up with for triggering "End ICU Occurrence" makes total sense when I look at the individual parts. By checking that there is a number/date in each of the discharge/time in/time out columns and that they are are filled (total 3), makes sure the patients with no ICU time or not yet discharged have a "blank" in the column. Then the countifs make sure that the patients with only one line of ICU time come up as "End ICU time". And using the lookup with Yes/No works for all the others. I might not be wording that correctly, but I think I understand how the parts of the formula come together to make it all work. It's fantastic!

  30. #30
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Thanks JohnTopley! I appreciate the info on file size limits.

  31. #31
    Forum Contributor
    Join Date
    06-30-2015
    Location
    Netherlands
    MS-Off Ver
    2013 / 2016 / 365
    Posts
    145

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi,

    came across this question and played a little bit with the larger Sample and your questions.
    This is what i came up with. Perhaps not most efficient solutions but maybe useful in further development.
    Attached Files Attached Files
    HtH,

    Joris

    --------------------------------------------------------------------------------
    If you found my answer helpful, please hit the Like or Thank button.

    Please follow the forum Rules and Guidelines and use Code tags around your VBA code.

    Remember: test VBA code always on a copy of your file because usually you can't use undo

  32. #32
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi Joris,
    Thank you for having a look at this and the proposed solution you have offered.

    My concern is that the formula you use in the minutes column contains references both column P and column Q. Column Q is only there (temporarily) to manually indicate what I wanted the formula in column Q to calculate, but it would be deleted from the worksheet, leaving only column P as a reference for other formulae.

    I tried to switch your formula references from Q to P, but then it doesn't work. Any suggestions how to eliminate any reference to column Q and use column P as the reference?

    I appreciate your efforts.

    Thanks

  33. #33
    Forum Contributor
    Join Date
    06-30-2015
    Location
    Netherlands
    MS-Off Ver
    2013 / 2016 / 365
    Posts
    145

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi,

    That's probably because it was just for fun trying to solve it.
    The formula's i used are array formula which must e confirmed with CTRL-Shift-Enter instead of just enter. If you do thatt correctly excel will place curly brackets around the formula.
    If you try that, if will give the same result as it did.

    I attached a new version in which i already changed it and it seems to work.
    Let me know if it does not.
    Attached Files Attached Files

  34. #34
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi Joris,

    From what I've read (and tried) with array formulas, I know they can be powerful, but cause too many problems if the users (including me) are not well aware of them. Also, from what I've tried, the data can't be sorted or rows added/deleted with arrays, and I need to add new lines every 2-3 days.

    Is there a way to make the formula work without the array (no Ctrl-Shift-Enter)?

    Thanks
    PS I agree Excel is fun to use and try new things with

  35. #35
    Forum Contributor
    Join Date
    06-30-2015
    Location
    Netherlands
    MS-Off Ver
    2013 / 2016 / 365
    Posts
    145

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Unfortunately, to my knowledge, there's no way to achieve your desired results without using array formulas. Perhaps some of the other guys is able to do it but I can't.

  36. #36
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi all,

    I finally managed to solve the issue with helper columns and a formula that didn't need to be an array! Thanks so much for the help along the way.

  37. #37
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Quote Originally Posted by CARD17 View Post
    Hi all,

    I finally managed to solve the issue with helper columns and a formula that didn't need to be an array! Thanks so much for the help along the way.
    CARD17,

    Glad to hear you found solution. I had a personal situation come up and was unable to stay with this thread to the end.

    Please, would you care to share the solution with us?

  38. #38
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi FlameRetired,

    I may actually have spoken to soon when I said it was solved; ran into a glitch today - will post if I get it fixed. Hope your situation worked out okay. If you have any thoughts on a solution to my time calculation question, I would still be interested in your thoughts.

    Thanks,

  39. #39
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    CARD17

    I am not clear on the logic behind the times calculations in your upload. See 'Encounter Number' 90736490039.

    The formula in R12 is =ROUNDUP((K12-J10)*1440,1). While I can understand the logic of the look-back to J10 there is a time gap included in that span unaccounted for (ex. K10 to J11 = 2:19). Is this intentional?

  40. #40
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi FlameRetired,
    For the sample encounter 90736490039 you mentioned, there would be a time gap between the time of transfer to the OR and the return to ICU, but the bed is still assigned so the OR gap is considered part of that ICU occurrence (hence calculated cell = Continued). The first ICU occurrence would end on the next line when transferred to floor (non-special care unit).
    There would again be a time gap from transfer to the floor until return to ICU for a second occurrence (and this gap must be excluded from time calculation for special care). Therefore, second ICU occurrence would begin on at the "time in" on the next line and continue until the next "end ICU occurrence.
    Dealing with the non-ICU time gaps seems to be the issue I can't overcome. Maybe another helper column is needed that would "look up" the "unit" (in addition to the "next tsf unit") - to determine the start time of the second, third, fourth ICU occurrence(s).
    Does that make sense?
    The array formula joris offered seems to work for everything except the ones that have multiple separate ICU occurrences that need separate time calculations.
    Thanks for having another look at this.

  41. #41
    Forum Contributor
    Join Date
    06-30-2015
    Location
    Netherlands
    MS-Off Ver
    2013 / 2016 / 365
    Posts
    145

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    CARD17,

    Really curious about your solution without using arrays.
    Took another look at the latest file and came across one issue with the formula which created some issues. Sorted that out.
    Attached Files Attached Files

  42. #42
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    For the sample encounter 90736490039 you mentioned, there would be a time gap between the time of transfer to the OR and the return to ICU,
    CARD17,

    I am not confident in my ability to follow this in hospital terms.

    Could you explain this in terms of cell addresses?

    Did that mean that the time gap between K10 and J11 is to be included in that (1st) section of 'Occurrence'?

    ie the calculation is K12 minus J10 as in your upload?


    Row\Col
    A
    J
    K
    P
    10
    90736490039
    2012/06/06 10:35
    2012/06/06 13:01
    Continued
    11
    90736490039
    2012/06/06 15:20
    2012/06/06 15:21
    Continued
    12
    90736490039
    2012/06/06 15:21
    2012/06/14 16:41
    End ICU Occurrence
    13
    90736490039
    2012/06/15 20:49
    2012/06/17 7:02
    Continued
    14
    90736490039
    2012/06/17 7:02
    2012/06/20 10:36
    End ICU Occurrence

  43. #43
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi FlameRetired,

    J10 - patient arrives, so this is start time of 1st ICU occurrence.
    K10 - patient either went to the OR or transferred to another ICU bed, so 1st ICU occurrence continues. In this case, you see a time gap between K10 and J11 (so patient was in OR but bed in ICU was still his/hers, so 1st ICU occurrence continues over the gap period.
    K11 - patient transfers to another ICU/stepdown unit, so no time gap between K11 and J12 - 1st ICU occurrence continues.
    K12 - patient transfers to a NON-ICU room, so 1st ICU occurrence ends - to recap - start time would be J10 and end time would be K12 for this 1st occurrence.
    Time gap between K12 and J13 is when the patient was in a NON-ICU room (reported and funded differently, so cannot be included in ICU time calculation). --> maybe the key is to determine the gap minutes and subtract it??
    J13 is when patient returned to ICU for a 2nd Occurrence - start time would be K13 and end time would be K14 for this 2nd occurrence.
    Does that help?

  44. #44
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi Joris,
    I'll have a look and test it to see if everything works now. Although, I really don't understand array formulas - whatever works is what I need.
    Thanks for your continued interest and assistance.

  45. #45
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Edit The was a small mistake in the original helper formula in column R.

    Thanks.

    I think this does it.

    In the attached only relevant columns are visible. I hid the rest.

    The formula in column P remains the same.

    Column R is a helper column. It defines the lower and upper boundaries of each 'Occurrence' including shared Encounter Numbers with multiple 'Occurrences'.

    Technically it is still an array formula, but does not require commitment Ctrl + Shift + Enter. It shouldn't be too resource hungry, but we won't know until applied to the real data.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The minutes calculations are in column S.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The days calculations are in column T
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and column U the total days.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 01-18-2017 at 12:38 AM. Reason: Small mistake in a formula

  46. #46
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi FlameRetired,
    I'll test it out at work tomorrow to see if it works, but now also need to add another criteria. So far, what I've been attempting to automate is the calculation of total ICU time by occurrence and total for encounter. Now, I also need to know how much of that ICU time was Post-operative. For this, I would need to have this worksheet look up the encounter number and pull the OR stop time, then compare that to the ICU start times to determine which part of the total days relates to the post-op period. Is this possible?
    Look forward to your insights.

  47. #47
    Registered User
    Join Date
    12-20-2016
    Location
    London, Ontario
    MS-Off Ver
    2010
    Posts
    27

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    Hi FlameRetired,
    I'll test it out at work tomorrow to see if it works, but now also need to add another criteria. So far, what I've been attempting to automate is the calculation of total ICU time by occurrence and total for encounter. Now, I also need to know how much of that ICU time was Post-operative. For this, I would need to have this worksheet look up the encounter number and pull the OR stop time, then compare that to the ICU start times to determine which part of the total days relates to the post-op period. Is this possible?
    Look forward to your insights.

  48. #48
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Total Hours each occurrence and Total Days for all occurences

    I'll have to study this one.

    It may be helpful if I wait for your feedback on my previous upload. I want to make sure I have that much of the concept right.

+ 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. [SOLVED] calculate total number of days between two days based on 365 days year
    By aparunkumar in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-14-2016, 12:51 AM
  2. Calculate Total Hours
    By sabubakaralis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-02-2015, 09:15 PM
  3. Converting Total Hours to Business Hours/Days
    By Fadooshy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-27-2015, 12:26 PM
  4. Replies: 14
    Last Post: 10-08-2014, 11:31 PM
  5. Need a formula to count occurrence of text and calculate a sum total
    By tgaito in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-30-2014, 01:55 PM
  6. Replies: 2
    Last Post: 11-16-2013, 05:19 PM
  7. Calculate total working days and excepted leave days
    By megaiooo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-21-2013, 09:29 AM

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