+ Reply to Thread
Results 1 to 6 of 6

How to count duplicate values (text) in a column only once?

  1. #1
    Registered User
    Join Date
    05-25-2016
    Location
    Hollywood, CA
    MS-Off Ver
    2016
    Posts
    79

    How to count duplicate values (text) in a column only once?

    I want to count the number of routes run by delivery drivers. Some routes get run by more than one driver, thus showing as duplicate values in the (date) column, e.g., col. B on the attached should show 8 routes. This seems pretty straightforward, but I can't hit upon the correct formulas to do it - can anyone point me in the right direction?
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: How to count duplicate values (text) in a column only once?

    Hi trstew,

    I call your kind of table a "crosstab" table. You have formatted your table so it is much harder for excel to deal with it. See the attached where I've taken your table and unpivoted it as shown on Sheet 3. This is a much easier table for Excel to deal with. You can then filter by driver. After working with pivot tables a bit, I'd bet you can get all you need after changing the format of your data.

    Route problem.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    08-04-2004
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    186

    Re: How to count duplicate values (text) in a column only once?

    based on your table try this
    =SUMPRODUCT(1/COUNTIF(B3:B17,B3:B17))-1

  4. #4
    Registered User
    Join Date
    05-25-2016
    Location
    Hollywood, CA
    MS-Off Ver
    2016
    Posts
    79

    Re: How to count duplicate values (text) in a column only once?

    Quote Originally Posted by philaugust2004 View Post
    based on your table try this
    =SUMPRODUCT(1/COUNTIF(B3:B17,B3:B17))-1
    Great, but how does this work?? Why does it not count cells containing "OFF"?
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: How to count duplicate values (text) in a column only once?

    Not sure I agree with your results: how do you get 5 routes on Sunday? There are only two DUR/MHH and BC (?)

    Try

    =SUMPRODUCT(1/COUNTIF(C3:C12,C3:C12))-SUM(IF(COUNTIF(C3:C12,{"PLANT","DISP","OFF","VAC"}),1,0))

    This discounts any of the entries in the COUNTIF as the SUMPRODUCT counts All unique entries including those in the COUNTIF part of the formula.
    Last edited by JohnTopley; 05-18-2017 at 05:03 PM.

  6. #6
    Registered User
    Join Date
    05-25-2016
    Location
    Hollywood, CA
    MS-Off Ver
    2016
    Posts
    79

    Re: How to count duplicate values (text) in a column only once?

    Yowza! Makes me feel really wet behind the ears... I guess I could efficientize the worker formula in row 14 to include an array variable also, correct?
    Thanks!

+ 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: 1
    Last Post: 08-02-2013, 09:58 PM
  2. Count Intervals of Filtered TEXT values in Column and Return Count across a Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. [SOLVED] Count Intervals of Filtered TEXT values in Column and Return Count across a Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. Replies: 18
    Last Post: 09-06-2005, 07:05 AM
  5. Replies: 18
    Last Post: 09-06-2005, 06:05 AM
  6. [SOLVED] Count Intervals of Filtered TEXT values in Column and Return Count across a Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. [SOLVED] Count Intervals of Filtered TEXT values in Column and Return Count across a Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  8. Count Intervals of Filtered TEXT values in Column and Return Count across a Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-30-2005, 11:05 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