+ Reply to Thread
Results 1 to 5 of 5

COUNTIFS with Unique Values

  1. #1
    Registered User
    Join Date
    06-17-2013
    Location
    Framingham, MA
    MS-Off Ver
    Excel 2007
    Posts
    5

    COUNTIFS with Unique Values

    Good Morning,

    I am in need of some assistance in writing a formula to accomplish the goal of counting only unique text values in a column, based upon two different factors:


    *Need to Count unique text values in column named 'CASE_NAME'
    *Column 'FISCAL' must match cell A5
    *Column 'ZONE' must match cell A3


    If you can help, I would appreciate it very much.

    Thank you,


    Dennis G

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: COUNTIFS with Unique Values

    Hi
    could you please post a sample sheet. Do you need unique or distinct values ?

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTIFS with Unique Values

    Try this array formula**:

    =SUM(IF(FREQUENCY(IF(FISCAL=A5,IF(ZONE=A3,MATCH(CASE_NAME,CASE_NAME,0))),ROW(CASE_NAME)-MIN(ROW(CASE_NAME))+1),1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: COUNTIFS with Unique Values

    Hard to tell without a worksheet what things should be, I've assumed fiscal is column D and zone is column C and that case_name is column B and entries are in rows 1 to 9.
    =SUM(IF(C1:C9=A3,1,0)*IF(D1:D9=A5,1,0)*IF((COUNTIF(B1:B9,B1:B9)=1),1,0))
    I've assumed that if a value is not unique, regardless of what is in fiscal and zone, it should be excluded.

    Edit: taking into account Tony's post with named ranges:
    =SUM(IF(ZONE=A3,1,0)*IF(FISCAL=A5,1,0)*IF((COUNTIF(CASE_NAME,CASE_NAME)=1),1,0))

    Both are array formulas so need to be entered with ctrl+shift+enter

  5. #5
    Registered User
    Join Date
    06-17-2013
    Location
    Framingham, MA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: COUNTIFS with Unique Values

    Tony, This works excellent, however I ran in to an issue. There are blank cells in the 'CASE_NAME' column, and in those instances the array formula is returning an #N/A error. Any way around that?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTIFS with Unique Values

    Still array entered...

    =SUM(IF(FREQUENCY(IF(FISCAL=A5,IF(ZONE=A3,IF(CASE_NAME<>"",MATCH(CASE_NAME,CASE_NAME,0)))),ROW(CASE_NAME)-MIN(ROW(CASE_NAME))+1),1))

+ 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 unique values based on two criteria
    By shaz0503 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-06-2012, 08:48 PM
  2. Countifs with unique values & dates
    By lanos in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-26-2012, 09:11 AM
  3. Replies: 2
    Last Post: 06-04-2012, 12:22 PM
  4. Replies: 6
    Last Post: 02-27-2012, 11:02 AM
  5. Excel 2007 : Using countifs to count unique values
    By AlexZoom in forum Excel General
    Replies: 2
    Last Post: 09-23-2010, 09:41 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