+ Reply to Thread
Results 1 to 12 of 12

Countifs, two criteria from a seperate sheet

  1. #1
    Registered User
    Join Date
    07-01-2015
    Location
    Rutland, Vermont
    MS-Off Ver
    2010
    Posts
    31

    Countifs, two criteria from a seperate sheet

    Hi all,

    I have an existing sheet that is organized by sequential seal numbers. Each seal number has a date broken, the person that broke it and the medication that was used. In a different sheet i want to count how many time a person used a specific medication. Im having trouble getting any formula to work. Any suggestions would be greatly appreciated.

    Thanks

    Starmusk10

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countifs, two criteria from a seperate sheet

    I suggest uploading a dummy worksheet (no confidential data) so we can see what information you have in what column (how your data is set up).
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    07-01-2015
    Location
    Rutland, Vermont
    MS-Off Ver
    2010
    Posts
    31

    Re: Countifs, two criteria from a seperate sheet

    I've attached the sample worksheet.

    From Column E, How many times did provider 6 use Fentanyl.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countifs, two criteria from a seperate sheet

    Does provider come from Column C or Column E or either? If it's either, then if it appears in both on the same line i.e. C14 and E14 = 6, does that count as 1 or 2 or "it'll never happen that way?"

  5. #5
    Registered User
    Join Date
    07-01-2015
    Location
    Rutland, Vermont
    MS-Off Ver
    2010
    Posts
    31

    Re: Countifs, two criteria from a seperate sheet

    Column E only. This column represents the provider who broke the seal and used meds. Column G represents the drug box used Column I is the med that was used.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countifs, two criteria from a seperate sheet

    Use COUNTIFS
    For example on Sheet2
    In A2 is provider
    In B2 is drug
    In C2
    =COUNTIFS(Sheet1!$C$2:$C$22, A2, Sheet1!$I$2:$I$22, B2)

    What if you'd asked about Midazolam? Row 17 had Midazolam twice. Would that count as 2 times? or is that a combination of drugs and would only be counted if you wanted "diazepam, Midazolam, Midalzolam"?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-01-2015
    Location
    Rutland, Vermont
    MS-Off Ver
    2010
    Posts
    31

    Re: Countifs, two criteria from a seperate sheet

    It would be counted twice. Row 17 would be 1 Diazepam and 2 Midazolam.

  8. #8
    Registered User
    Join Date
    07-01-2015
    Location
    Rutland, Vermont
    MS-Off Ver
    2010
    Posts
    31

    Re: Countifs, two criteria from a seperate sheet

    Take a look in row E, Thats the row that Provider 6 used Fentanyl and morphine in two seperate occasions but I only want to count the fentanyl use. How do I specify what ned I want counted.

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countifs, two criteria from a seperate sheet

    Okay, try this formula in C2 instead

    =SUMPRODUCT(--($I$3:$L$22=B2)*(E3:E22=A2))

  10. #10
    Registered User
    Join Date
    07-01-2015
    Location
    Rutland, Vermont
    MS-Off Ver
    2010
    Posts
    31

    Re: Countifs, two criteria from a seperate sheet

    That one didnt work. It didnt specify what sheet to take the information from. or the specific drug to look for.

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countifs, two criteria from a seperate sheet

    My mistake, should have read

    =SUMPRODUCT(--(Sheet1!$I$3:$L$22=B2)*(Sheet1!E3:E22=A2))
    The drug name is in B2, the provider is in A2
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    07-01-2015
    Location
    Rutland, Vermont
    MS-Off Ver
    2010
    Posts
    31

    Re: Countifs, two criteria from a seperate sheet

    That works! Thank you!

+ 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. Countifs with multiple criteria in single criteria range
    By MCP313 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-01-2016, 03:51 AM
  2. Replies: 10
    Last Post: 12-03-2014, 02:29 AM
  3. [SOLVED] Countifs with multiple criteria and one criteria has a list of names
    By Beefy1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-30-2014, 05:25 PM
  4. Lookup values given certain criteria using VBA and paste into a formatted seperate sheet
    By engineeringirl89 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2013, 06:47 PM
  5. Replies: 4
    Last Post: 03-21-2013, 10:02 AM
  6. [SOLVED] Input summary info into a seperate sheet where multiple criteria are required
    By Anthem12 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-07-2013, 12:11 PM
  7. Replies: 2
    Last Post: 11-06-2012, 06:40 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