+ Reply to Thread
Results 1 to 4 of 4

Count number of unique values in Column A that match a term in Column B

  1. #1
    Registered User
    Join Date
    07-04-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    24

    Count number of unique values in Column A that match a term in Column B

    Our company ships items, and we have two statuses: "prep" for items that still need to be washed and cleaned, and "ship" for items that need to be boxed. We want to know how many products still need to be prepped, and the ones that need to be shipped, so we have one column that either shows "prep" or "ship", and another column with the name of the product. Each row represents one physical item, so if we have 10 items, there will be 10 rows.

    Getting the number of physical items that need prepping or shipping was easy, we just used this formula:
    Please Login or Register  to view this content.
    However, I want to find the number of unique products in the product column, but *only* if the value in the prep/ship column contains either "prep" or "ship".

    Let me show you the steps I have done so far:

    It looks like this is the closest formula that I can find, using the FREQUENCY formula: https://exceljet.net/formula/count-u...ues-in-a-range

    Using this information, I came up with this formula:

    Please Login or Register  to view this content.
    But of course that is not working.

    G is the prep/ship column, and J is the product column.

    The page I referenced above said that the FREQUENCY formula is more complex, but computes much faster, so I'm looking for a formula that will do this computation without bogging down our already slow workbook. Any ideas?

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

    Re: Count number of unique values in Column A that match a term in Column B

    Try it like this...

    =SUM(IF(FREQUENCY(IF($G$2:$G16184="prep",IF($J$2:$J16184<>"",MATCH($J$2:$J16184,$J$2:$J16184,0))),ROW($J$2:$J16184)-ROW($J$2)+1),1))

    Still array entered.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    07-04-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    24

    Re: Count number of unique values in Column A that match a term in Column B

    Awesome! That did the trick! Thanks!

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

    Re: Count number of unique values in Column A that match a term in Column B

    You're 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: 12
    Last Post: 01-16-2016, 10:13 AM
  2. Replies: 4
    Last Post: 10-09-2015, 05:19 AM
  3. [SOLVED] Using INDEX MATCH to return unique values for non-unique search term
    By rico_suave in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-03-2015, 01:53 AM
  4. Count number of all unique values down a column
    By nature718 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-13-2014, 08:47 PM
  5. [SOLVED] count number of values in one column if unique value in another.
    By j.farr3ll in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-16-2013, 06:08 AM
  6. Replies: 4
    Last Post: 07-16-2013, 09:45 AM
  7. Replies: 12
    Last Post: 07-03-2012, 04:50 PM

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