+ Reply to Thread
Results 1 to 7 of 7

COUNTIF Alternative for multiple criteria?

  1. #1
    Registered User
    Join Date
    03-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    17

    COUNTIF Alternative for multiple criteria?

    Hi all,

    I am currently in the process of creating a lateness report

    Example of the data sheet.

    Col B = Lateness code ie "Lunch"
    Col F = Duration of the lateness ("HH:MM:SS")
    Col H = Area where they work

    Basically what im after is to work out if the occurance is over 3 minutes to calculate how many (Collum B) but only if the code is "Lunch" & area "Retail".

    From my understanding I can't work this out with a single countif because it has more than one criteria?

    Thanks in advance for any help

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: COUNTIF Alternative for multiple criteria?

    COUNTIF.......no
    COUNTIFS....yes!

    With
    Col_B containing the codes
    Col_F containing the durations
    Col_H containing the areas

    And
    J1: a code to match....eg Lunch
    K1: an area to match...eg Retail
    L1: a threshold to exceed....eg 3 min

    This formula counts the number of instance where the Retail Area was late more than 3 minutes for a Code of Lunch:
    M1: =COUNTIFS(B2:B30,J1,H2:H30,K1,F2:F30,">"&L1)

    Adjust range references to suit your situation.
    Alternatively, since you're using Excel 2007, you could reference entire columns:
    M1: =COUNTIFS(B:B,J1,H:H,K1,F:F,">"&L1)

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    03-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: COUNTIF Alternative for multiple criteria?

    Hi Ron,

    That works great, I really appreciate your help with this. Could I ask will COUNTIFS work with previous versions of exel? Also, If there was a name in collum A is there a way your formula above could determine where this was a unique name?

    Once again thank you for your help & response to this

    Dan

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: COUNTIF Alternative for multiple criteria?

    • The COUNTIFS (and SUMIFS, and some other functions) were added in Excel 2007 and later.
    • If you post a unique name example and the results you want to see, we'll try to help.

  5. #5
    Registered User
    Join Date
    03-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: COUNTIF Alternative for multiple criteria?

    Hi Ron,

    Following my inital example, basically, in column A there are a list of names (duplicates in most cases) - is there a way this can be narrowed down to occurances over 3 minutes but only unique individuals? (Ie, if they have 3 occasions over 3 minutes that it only counts 1)?

    Also, I would be using this work with Excel 2003 unfortunately - is there an alternative function that this formula would work with?

    Many thanks for your help

    Dan
    Last edited by Dan17602; 03-20-2011 at 07:25 PM.

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: COUNTIF Alternative for multiple criteria?

    OK...I understand: Your profile indicates Excel 2007, but, in this case you need a solution for Excel 2003.

    However, I'm not really sure what you want the formula to do now.
    For a count of the number of instances where the Retail Area was late more than 3 minutes for a Code of Lunch, try this regular formula (which will work in Pre-Excel 2007 versions):
    Please Login or Register  to view this content.

    And for the count of instances where a Col_A name:
    • Appears only once
    • Has a code of Lunch
    • Has an area of Retail
    • Is late more than 3 minutes.
    Try this regular formula:
    Please Login or Register  to view this content.


    Is that something you can work with?
    ...If: No, can you post some sample data and what results you want to see (based on that data)?

  7. #7
    Registered User
    Join Date
    03-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: COUNTIF Alternative for multiple criteria?

    Hi Ron,

    This worked brilliant, exacly what I was after

    Many thanks again for your help!

+ 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