+ Reply to Thread
Results 1 to 8 of 8

Count If and a ton of conditions

  1. #1
    Registered User
    Join Date
    01-24-2019
    Location
    PA, USA
    MS-Off Ver
    2016
    Posts
    4

    Count If and a ton of conditions

    Hi All! I joined this forum specifically because of this problem, so I'm hoping someone can help.

    I'm using Microsoft Excel 2016 on Mac.

    I have a multi-sheet spreadsheet with dates (Column A), Patient numbers (Column B), and Patient last name (Column C). I am in charge of pulling reports from this spreadsheet every month to count how many unique patients were seen. Most patients are seen multiple times a month. This usually requires me to sort the list and hand count them (I know I know.. so anti-Excel). I want to automate this report so I can type in a date range (ie: 8/1/18 (cell B1) and 8/31/18 (cell C1) ) and it automatically counts the unique visits in that range. Is this possible? I've done do much research and can't seem to find what I'm looking for. Ideas?

    Thank you!

    Tracy

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Count If and a ton of conditions

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Count If and a ton of conditions

    What I normally do to count unique values in a Pivottable. Then you can also use eighter a timeline or slicer to select a period

    All you need on top of the pivottable is a cell with a COUNTA formula that starts below Headerrow select a long range so that no patients will be missed due to short range so set for example F3:F500 as range. Also be aware of a total row as that will be counted as 1 argument to.

    It will help a lot if you have an example file fake patients names to show you how. Instead of an explanation only

  4. #4
    Registered User
    Join Date
    01-24-2019
    Location
    PA, USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Count If and a ton of conditions

    Quote Originally Posted by TMS View Post
    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    I believe I attached a very simplified version.
    Attached Files Attached Files

  5. #5
    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: Count If and a ton of conditions

    Try array entering this formula.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  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: Count If and a ton of conditions

    This non array entered also works.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-24-2019
    Location
    PA, USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Count If and a ton of conditions

    Quote Originally Posted by FlameRetired View Post
    This non array entered also works.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I attempted to use this formula because I wasn't sure about the array-entered formula. It is giving me a DIV/0 error. I had to change some of the details because the name of the second page (2018 in the one I send) is different and the data expands from A7:A3000. So I replaced and this is the formula now: =SUMPRODUCT((('2018 For Luella'!A7:A3000>=B1)*('2018 For Luella'!A7:A3000<=C1))/COUNTIFS('2018 For Luella'!B7:B3000,'2018 For Luella'!B7:B3000,'2018 For Luella'!A7:A3000,">="&B1,'2018 For Luella'!A7:A3000,"<="&C1)). I can sort of follow this formula with the countifs but am not familiar with the sumproduct portion.

  8. #8
    Registered User
    Join Date
    01-24-2019
    Location
    PA, USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Count If and a ton of conditions

    Thank you for this idea. I am attempting to pass this task on to some who is very unfamiliar with Excel, so I think a Pivottable would be too complex. I should have mentioned that in my original post!

+ 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. Cannot count using two conditions
    By RollingStone88 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2018, 09:09 AM
  2. [SOLVED] Count if with conditions...
    By Winterfell in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 02-05-2016, 04:27 PM
  3. [SOLVED] Count with two conditions
    By jewellove in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-11-2013, 10:37 AM
  4. count with two conditions
    By kghisla in forum Excel General
    Replies: 2
    Last Post: 12-04-2010, 10:01 PM
  5. How to Count with 2 conditions?
    By Lewis Koh in forum Excel General
    Replies: 6
    Last Post: 04-21-2010, 11:48 AM
  6. count with two conditions
    By prasjohn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-21-2008, 02:19 PM
  7. Count with 2 conditions?
    By Lee in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-18-2005, 11:06 PM

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