+ Reply to Thread
Results 1 to 8 of 8

count the number of unique text records with multiple criteria

  1. #1
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    count the number of unique text records with multiple criteria

    I am trying to count the unique number of times the name of a client appears in a worksheet based on the specific primary sales rep and secondary sales rep who is assigned to the account, as well as a date range.
    Below is an attached excel file offering an outline of what I am trying to solve.

    Thanks in advance
    Attached Files Attached Files
    Last edited by Perk1961; 06-22-2016 at 10:57 AM. Reason: I was able to attach my excel sample file.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: count the number of unique text records with multiple criteria

    I have a solution (see Sheet2) that uses a pivot table trick. First it makes a "composite key" of the factors that make a record unique. Then what it does is take the inverse of the count of how many times that composite key appears. So if there are two of the same it's 1/2, if there are three of the same, it's 1/3, etc. This sets it up so that when the pivot table sums them up, they add back up to 1 and are only counted as one.

    So Craig has two entries for ABC Company where there is no backup sales rep. We only want to count these two records once, so they each get a half value.

    Then it's a matter of putting the information into the pivot table.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    Re: count the number of unique text records with multiple criteria

    Thank you. I was actually looking to use a formula that did not involve Pivot tables because I need to ultimately incorporate it into a Google Sheets. I was thinking a SumProduct with and And solution could work, but not sure how to write it.The other is perhaps a CountIf formula with an AND solution.

    Attached is an revised excel clarifying the problem at hand.

    Thanks in advance.
    Attached Files Attached Files

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: count the number of unique text records with multiple criteria

    Try this for unique companies by date in D14.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit And this in C18:C20
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 06-22-2016 at 02:34 PM.
    Dave

  5. #5
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    Re: count the number of unique text records with multiple criteria

    This is much closer. I just need the total count to include where the rep appears as a primary and backup sales rep. As such, the answer for Craig should be 4, joe is 3 and Mark is 2.

    I am also looking to include in this same formula a date range so the results will take that into consideration. I hope that makes sense.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: count the number of unique text records with multiple criteria

    Got it.

    Try array entering this in C18 and filling down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

  7. #7
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    Re: count the number of unique text records with multiple criteria

    Fantastic! Thank you so much!
    Last edited by Perk1961; 06-22-2016 at 03:37 PM. Reason: spelling error on my part.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: count the number of unique text records with multiple criteria

    You are welcome. Thanks for the feedback.

+ 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: 4
    Last Post: 11-26-2014, 04:52 AM
  2. Count unique records relative to multiple criteria
    By MStyles in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-15-2013, 09:56 AM
  3. Formula to count Unique text based on multiple criteria
    By OAMPS in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2012, 10:48 AM
  4. [SOLVED] Count - Multiple Mixed Criteria (Number and Text)
    By christopherprater in forum Excel General
    Replies: 4
    Last Post: 05-19-2012, 03:56 PM
  5. Count unique records with criteria
    By vancoservices in forum Excel General
    Replies: 4
    Last Post: 08-24-2010, 09:13 AM
  6. Formula to count unique number of records in a column
    By stats09 in forum Excel General
    Replies: 3
    Last Post: 03-22-2010, 10:15 PM
  7. Count the number of unique records
    By [email protected] in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-08-2006, 03:35 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