+ Reply to Thread
Results 1 to 8 of 8

Count Number of Patient's present during an hour Episode

  1. #1
    Registered User
    Join Date
    11-09-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Count Number of Patient's present during an hour Episode

    Hello,

    I use excel common formulas often but am a neophyte when it comes to more complex formulas. I am working on a Recovery Room staffing project for a Director of Nursing. She wants to know the the number of patients in her rocovery room at hour intervals. I want to be able to count that between 8:00-8:59 there were x number of patients in Recovery and so on etc for the different hour intervals for a day. I have attached a sample spreadsheet. Feel free to change around what ever you want. Can you also explain what the parts of your formula are doing so I can learn how to do it for other projects?

    Thanks in advance for you help, I love this forum!

    Jason
    Attached Files Attached Files

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Count Number of Patient's present during an hour Episode

    The easiest solution is to use a Pivot Table and group the time values by hour.

    Also, you could use this SUMPRODUCT formula.

    =SUMPRODUCT(--($B$2:$B$8>=E2)*--($B$2:$B$8<=F2))

    See this page for explanation on how the SUMPRODUCT function works.

    Sumproduct Explained
    Attached Files Attached Files
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Count Number of Patient's present during an hour Episode

    Alternatively, use COUNTIFS, which count cells in a range that meet certain criteria. Here, I've tested for ones starting within the hour plus those ending in the hour, minus those both starting and ending in the hour (to avoid double-counting). Same result as SUMPRODUCT but maybe easier to follow.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-09-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Count Number of Patient's present during an hour Episode

    Palmetto and Bentley bob thanks for the reply. Bently bob I think yours fits a little more because it counts the patients that are in the recovery room during each hour which includes double counting each patient if they are in two different hours. Palmetto yours just counts the hour. I do thank both of you for the help. I learned something from each one of your posts thanks for the help!!

    Whamps

  5. #5
    Registered User
    Join Date
    11-09-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Count Number of Patient's present during an hour Episode

    Bentley bob I have one more question. I found a snag in the formulas. If the recovery period extended over three hours 8:00 - 10:45 it only counts 8:00 and the 10:00 hour skipping over 9:00 would you know how to fix this? See attached

    Thanks
    Jason
    Attached Files Attached Files

  6. #6
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Count Number of Patient's present during an hour Episode

    My bad. Add the following to cell I3 and copy it down.

    +COUNTIFS($B:$B,"<"&$G3,$C:$C,">"&$H3)

  7. #7
    Registered User
    Join Date
    03-15-2013
    Location
    Baltimore
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Count Number of Patient's present during an hour Episode

    Hello, I tried to use the formula you used for Jason's project but it's giving me negative results.

    Thank you for the help!
    Attached Files Attached Files

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Count Number of Patient's present during an hour Episode

    Jomejorada,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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