+ Reply to Thread
Results 1 to 18 of 18

Count with multiple criteria but duplicates only once

  1. #1
    Registered User
    Join Date
    07-19-2015
    Location
    Colombia
    MS-Off Ver
    2010
    Posts
    9

    Count with multiple criteria but duplicates only once

    I have the following table:

    Column A - Equipment Number Column B - Level Column C-Work Column D - Type Column E - Status
    11160085 C3 MECHANICS PREV OK
    11160085 C3 ELECTRONICS PREV OK
    11160085 B MECHANICS PREV OK
    11160085 B ELECTRONICS PREV PEN
    11071846 C MECHANICS CERT OK

    I need to count every equipment that has status OK and type PREV. However the tricky part is that only if the equipment has status OK on both mechanics and electronics (column C) should it be counted once.
    For example the count for the table above should be 1. Only equipment number 11160085 has OK for level C3 on both Mechanics and Electronics and both are type PREV. If I were to change row 2 to Status to Pen, then the count should be 0. If rows 1 through 4 had status OK, then the count should be 2.

    I've tried to use SUM array formula {SUM((E2:E5="OK")*(D2:D5="PREV"))*(C2:C5="MECHANICS"))*SUM((E2:E5="OK")*(D2:D5="PREV"))*(C2:C5="ELECTRONICS"))} and it works fine if the table only had rows 1 and 2. Once I add rows 3 and 4 it does not count correctly.

    Any help would be greatly appreciated.

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count with multiple criteria but duplicates only once

    I think that the sample is really too small to see if this really works but give it a try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    OOPS - fails my tests will get back to you.
    Last edited by newdoverman; 07-19-2015 at 11:20 AM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count with multiple criteria but duplicates only once

    Enter this ARRAY formula in G2 and fill down (Entered with Ctrl + Shift + Enter) to list the unique equipment numbers in column A.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Try this in H2 and fill down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    A
    B
    C
    D
    E
    F
    G
    H
    1
    Equipment Number Level Work Type Status Count
    2
    11160085
    C3 MECHANICS PREV OK
    11160085
    1
    3
    11160085
    C3 ELECTRONICS PREV OK
    11071846
    0
    4
    11160085
    B MECHANICS PREV OK
    5
    11160085
    B ELECTRONICS PREV PEN
    6
    11071846
    C MECHANICS CERT OK

  4. #4
    Registered User
    Join Date
    07-19-2015
    Location
    Colombia
    MS-Off Ver
    2010
    Posts
    9

    Re: Count with multiple criteria but duplicates only once

    Thanks.

    However I cant use the level C3 as a counting criteria because I want the count to reflect a general compliance percentage.

    What I can tell you is that no equipment has a repeated level and work.

    For example 11160085 - C3 - MECHANICS - PREV would only be found once in the table data. That combination is unique.

    On the other hand 11160085-C3-PREV would only be found twice in the table data.

    Hope this info helps!!

  5. #5
    Registered User
    Join Date
    07-19-2015
    Location
    Colombia
    MS-Off Ver
    2010
    Posts
    9

    Re: Count with multiple criteria but duplicates only once

    The formula Im looking needs to work independent of the level criteria.

    For example in the table you posted, if you change row 5 to status OK, the count should change to 2.

    Because it counts with C3 criteria, it will not do so.

  6. #6
    Registered User
    Join Date
    07-19-2015
    Location
    Colombia
    MS-Off Ver
    2010
    Posts
    9

    Re: Count with multiple criteria but duplicates only once

    To make myself clear. This is how I want to count:

    EXAMPLE.PNG

  7. #7
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Count with multiple criteria but duplicates only once

    But it appears that the Level criteria is a 'pairing' mechanism - ie.
    11160085 C3 MECHANICS PREV OK
    11160085 C3 ELECTRONICS PREV OK
    are a matched pair, and together equal a count of 1.
    So surely in our solution, using level is a useful grouping criteria. Or am I misinterpreting this?

  8. #8
    Registered User
    Join Date
    07-19-2015
    Location
    Colombia
    MS-Off Ver
    2010
    Posts
    9

    Re: Count with multiple criteria but duplicates only once

    Here are some examples of how the count should change if I modified status column.

    EXAMPLE.PNG

    EXAMPLE-1.PNG

  9. #9
    Registered User
    Join Date
    07-19-2015
    Location
    Colombia
    MS-Off Ver
    2010
    Posts
    9

    Re: Count with multiple criteria but duplicates only once

    Cyangou,

    The problem relies that I need a Division general count as shown by the images so that when the user manually modifies the status column, the division count increases or decreases. If I use the Level as a criteria I would need to take into account all possible levels A-B-C-D-B1-C1-C2-C3-C4-B1-B2-B3-B4 present in the Level array.

  10. #10
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Count with multiple criteria but duplicates only once

    Ignoring your warnings about Level (mostly because I didn't understand them), I've used it in my pairing mechanism:

    Count with multiple criteria but duplicates only once.xlsx

    Please see if it works for you.

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count with multiple criteria but duplicates only once

    Why would the second picture not indicate 1? There would be a match for mechanics, Electronics and OK for the same equipment. If it isn't 1, I don't understand your criteria at all.

  12. #12
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Count with multiple criteria but duplicates only once

    Because for each matched pair, there must be 2 OKs. I include level to determine matched pairs.
    Last edited by cyiangou; 07-19-2015 at 12:10 PM.

  13. #13
    Registered User
    Join Date
    07-19-2015
    Location
    Colombia
    MS-Off Ver
    2010
    Posts
    9

    Re: Count with multiple criteria but duplicates only once

    Cyangou,

    It works fine if each level has only one pair of data. Once you add another pair it does not work.

    EXAMPLE.PNG

  14. #14
    Registered User
    Join Date
    07-19-2015
    Location
    Colombia
    MS-Off Ver
    2010
    Posts
    9

    Re: Count with multiple criteria but duplicates only once

    NewDoverman,

    I understand your confusion. I incorrectly put the same number of equipment in rows 1 through 4.

    Take a look at the picture I just posted for cyangou. See if it clarifies your criteria confusion.

  15. #15
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Count with multiple criteria but duplicates only once

    Ok, that changes things. A completely different approach:

    Count with multiple criteria but duplicates only once2.xlsx

  16. #16
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count with multiple criteria but duplicates only once

    I'm out. Someone else can play with this.

  17. #17
    Registered User
    Join Date
    07-19-2015
    Location
    Colombia
    MS-Off Ver
    2010
    Posts
    9

    Re: Count with multiple criteria but duplicates only once

    Cyangou,

    You have just made my day.

    Thanks!!!!!!!!

  18. #18
    Forum Contributor
    Join Date
    07-16-2015
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Count with multiple criteria but duplicates only once

    Have a look and see if this is what you are after

    Example.xlsx

+ 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. Replies: 5
    Last Post: 05-04-2014, 10:56 AM
  2. [SOLVED] Sum and Count without duplicates and with criteria
    By joeldlow in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-08-2014, 02:55 AM
  3. [SOLVED] count with multiple criteria without duplicates based on a different column
    By antagonanin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-14-2013, 09:46 AM
  4. How to count cells that meet multiple criteria, leaving out duplicates
    By jsgray in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-11-2013, 07:26 AM
  5. Replies: 3
    Last Post: 05-23-2013, 07:50 PM
  6. [SOLVED] Count without duplicates based on multiple criteria from different cells
    By perryadam in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2013, 12:54 PM
  7. Count first entries (ignore duplicates) against multiple criteria
    By Bazza in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-28-2008, 11:44 AM

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