+ Reply to Thread
Results 1 to 6 of 6

Using COUNTIFS with multiple ranges & criteria...how to count unique / exclude duplicates?

  1. #1
    Registered User
    Join Date
    05-04-2014
    Location
    Egypt
    MS-Off Ver
    Excel 2013
    Posts
    3

    Using COUNTIFS with multiple ranges & criteria...how to count unique / exclude duplicates?

    Hello!

    I am trying to get a count of reports we published, where I have taken data from another source which contains some items marked 'n/a' to be excluded from the count, and I want the count separated into specified time periods. Cells with no values are also excluded. I have figured out formulas to achieve this so far, but I need it to count unique values, as for the purposes of the original source data which is grouped differently, the reports come listed once per subject, even though the same report may cover multiple subjects.

    For the 1Q14 count, I have given the formula:
    Please Login or Register  to view this content.
    ...where the E range contains the names of reports and the D range contains the dates. G1 and G2 are the start and end dates of the 1Q14 period. Sometimes 2 or more uniquely-titled reports were issued on the same day so duplicate dates should be counted, but duplicate report titles only once.

    I've put this sheet up as a Google Spreadsheet to illustrate: https://docs.google.com/spreadsheets...it?usp=sharing

    Any help would be much appreciated.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Using COUNTIFS with multiple ranges & criteria...how to count unique / exclude duplica

    Hi and welcome to the forum.

    It would be useful if you could add a few manually-calculated results to your sheet so that we know what we're aiming for.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    05-04-2014
    Location
    Egypt
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Using COUNTIFS with multiple ranges & criteria...how to count unique / exclude duplica

    Thank you for the welcome, and thanks also for taking a look at this.

    In the Google Spreadsheet I had added comments to the cells containing formula-calculated counts for the 1Q13 and 3Q13 periods. They are giving 16 and 40 respectively, where I believe they should return 14 and 7 excluding duplicates. I believe 2Q13 is accurate with 11, and I haven't manually gone through the rest. Is that a good enough start?

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Using COUNTIFS with multiple ranges & criteria...how to count unique / exclude duplica

    in cell G4, the following array formula:

    Please Login or Register  to view this content.
    please upload spreadsheets here in this forum - see forum rules on how to do that.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Using COUNTIFS with multiple ranges & criteria...how to count unique / exclude duplica

    Thanks. I get 8 for 3Q13, so perhaps you could double-check.

    Try this array formula** in G4:

    =SUM(IF(FREQUENCY(IF($E$4:$E$896<>"n/a",IF($E$4:$E$896<>"",IF($D$4:$D$896>=G1,IF($D$4:$D$896<=G2,MATCH($E$4:$E$896,$E$4:$E$896,0))))),ROW($E$4:$E$896)-MIN(ROW($E$4:$E$896))+1),1))

    Copy across as required.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

  6. #6
    Registered User
    Join Date
    05-04-2014
    Location
    Egypt
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Using COUNTIFS with multiple ranges & criteria...how to count unique / exclude duplica

    Thanks to both of you, both of these solutions work brilliantly!

    And you are right, XOR LX, the count for 3Q13 should be 8, not 7.

    Extremely grateful.

+ 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. [SOLVED] =sum(countifs(range,{not this, not this, nor this} -How to exclude criteria in this manner
    By nscarritt in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-26-2014, 04:00 PM
  2. Replies: 3
    Last Post: 08-26-2013, 03:31 PM
  3. [SOLVED] Need to use either COUNTIFS or SUMPRODUCT to count rows based on multiple criteria
    By erabinov in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-15-2013, 03:15 PM
  4. Replies: 3
    Last Post: 05-23-2013, 07:50 PM
  5. Replies: 4
    Last Post: 03-30-2013, 08:36 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