+ Reply to Thread
Results 1 to 8 of 8

Need Help with Countif or countifs

  1. #1
    Registered User
    Join Date
    02-27-2013
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    4

    Need Help with Countif or countifs

    Hi,

    I work for a hospital and am new to this forum. I have been able to count the number of people in the our ED at a certain hour of a certain day called the hourly census.

    Census uses this forumula:
    =F2-(COUNTIF(D2:D9451, "<="&H2)+COUNTIF(B2:B9451,">="&H2))
    (Total # of Patients) - ((Number of patients who departed before hour x)+(Number of patients who arrived after hour x))

    Now I need to know the census in the ED by Acuity. Acuity is the assigned medical emergency code we give patients at triage.

    For example, I want to show the number of patients in the ED at 2AM with an acuity of 1,2,3,4, or 5.

    Attached my worksheet for help.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,706

    Re: Need Help with Countif or countifs

    You should be able to do this using the CountIFS function. It allows for multiple criteria

    The syntax for this function can be found here--> http://office.microsoft.com/en-us/ex...010047494.aspx

    Alan
    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
    02-27-2013
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need Help with Countif or countifs

    I've tried but it doesnt work. I get 0 with the following equation.

    =COUNTIFS(D3:D9452,"<="&H3,B3:B9452,">="&H3,C3:C9452,"3 - Urgent")

  4. #4
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Need Help with Countif or countifs

    I have 2 formula:
    This code use if the time for criteria place on cell with time format.
    Please Login or Register  to view this content.
    This code if you input the time manuall
    Please Login or Register  to view this content.
    Note :
    Don't forget use ctrl+shift+enter
    Click (*) if you received helpful response.

    Regards,
    David

  5. #5
    Registered User
    Join Date
    02-27-2013
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need Help with Countif or countifs

    SDCH, This is close but not yet correct. I put in the formula and dragged it down for one day. The total for each acuity for the day ended up being the sum of the acuities for the month.

    The sum of the acuities at each hour/of each day should equal the census. For example, the census from 1/1/2013 0:00 to 1/1/2013 0:59 is 77 people. The sum of the acuities at this hour will equal 77.

    Thanks in advance!

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,706

    Re: Need Help with Countif or countifs

    Look at the attached. Used Sumproduct. Only did the first row which ties to your 77. You can build and copy down as shown.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-27-2013
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need Help with Countif or countifs

    The first day works perfect. I'm going to manually count a few hours but it looks perfect.

    Thanks so much alansidman!!

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,706

    Re: Need Help with Countif or countifs

    You are welcome. Thanks for the reps.

+ 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