+ Reply to Thread
Results 1 to 9 of 9

Count Unique Values with Duplicates in Multiple Columns

  1. #1
    Registered User
    Join Date
    11-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Count Unique Values with Duplicates in Multiple Columns

    Greetings everyone!

    I want to provide a function which will count the number of applications greater than or equal to 25 days over due date while only considering the most recent individual "Application Type" per "Company No.". By most recent I mean that an "Updates" over rides an "Originals". If an application has multiple "Updates" only consider the days over due date of the most recent "Update".

    I have been trying various iterations of the following function: =SUM(IF(FREQUENCY(IF(MATCH(A3:A8,A3:A8,0))))),ROW(A3:A8)-ROW(A3)+1),1)). However, as stated above I am trying to count the most recent application and this function is not quite fitting the bill.

    I have attached a sample file which shows the highlighted results I would like the function to count.

    Any help is greatly appreciated! Please let me know if anything is unclear.
    Attached Files Attached Files

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Count Unique Values with Duplicates in Multiple Columns

    See if is this you want
    IN G3 use the following formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy down.
    The lines where the application is over due date >=25 are marked with the days over due

  3. #3
    Registered User
    Join Date
    11-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Count Unique Values with Duplicates in Multiple Columns

    Thank you for your reply, Jose. The function you provided works; however, my data set has over 17000 different company numbers and it appears that you equation can only accommodate the three companies in the sample sheet.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Count Unique Values with Duplicates in Multiple Columns

    Hi @sTeezZy
    You can use for as many companies as you wish. Adjust the formula to your range
    =IF(A3&B3&TEXT(AGGREGATE(14,6,(--($E$3:$E$18000>=25)*($A$3:$A$18000=A3)*($B$3:$B$18000=B3)*($D$3:$D$18000)),1),"dd-mm-yyyy")=A3&B3&TEXT(D3,"dd-mm-yyyy"),E3,"")

  5. #5
    Registered User
    Join Date
    11-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Count Unique Values with Duplicates in Multiple Columns

    Jose, I added a fourth company with updated application which was over the 25 limit; however, when I applied an update to the original application for the fourth company, which was within the 25 day limit, the function counted the original. The update needs to over rider the original. I have attached a copy to show what I attempted to explain here. Thanks!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Count Unique Values with Duplicates in Multiple Columns

    I believe the simplest way to accomplish this task would be to have excel first view the company number, then view the application types associated with that company number, and then determine what is the day over on the most recent update of each application and count the applications where the day over is over the 25 limit.

  7. #7
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Count Unique Values with Duplicates in Multiple Columns

    Hi
    Try this
    =IF(A3&B3&TEXT(AGGREGATE(14,6,(($A$3:$A$1800=A3)*($B$3:$B$1800=B3)*($D$3:$D$1800)),1),"dd-mm-yyyy")=A3&B3&TEXT(D3,"dd-mm-yyyy"),IF(E3>=25,E3,""),"")
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Count Unique Values with Duplicates in Multiple Columns

    Jose, you last function works great! Thank you for all your help.

    If you wouldn't mind could you explain what the AGGREGATE function is doing as we as the A3&B3&TEXT string?

    Thanks again!

  9. #9
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Count Unique Values with Duplicates in Multiple Columns

    Hi @sTeezZy
    What I do is concatenate A3,B3 and the larger date in format "dd-mm-yyyy" in Column D3 where the rows has same value in column A as A3 and same value in column B as B3.
    larger --> AGGREGATE(14,6, ... (same as LARGE but we can operate with ranges (14 is LARGE, 6 is Ignore error)) --> We get the larger date XX of A3 and B3 that is or is not the same as D3
    TEXT(AGGREGATE....;"dd-mm-yyyy") ---> Convert the date in that format
    If in the row n An=A3, Bn=B3 and Dn=XX Then IF En is greater or equal to 25 Mark with En Else don't mark!

    Don't forget to mark this thread as SOLVED.
    Best regards

+ 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: 3
    Last Post: 08-26-2013, 03:31 PM
  2. Replies: 3
    Last Post: 05-23-2013, 07:50 PM
  3. Count unique values across 2 columns with multiple criteria
    By Skywalker01 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-29-2012, 08:04 AM
  4. Replies: 16
    Last Post: 01-11-2012, 10:51 AM
  5. Replies: 11
    Last Post: 06-09-2011, 03:17 PM
  6. Replies: 5
    Last Post: 04-21-2011, 05:22 PM
  7. Count Unique Values In A Filtered Row with Duplicates
    By jcpotwor in forum Excel General
    Replies: 1
    Last Post: 01-12-2006, 09:10 PM
  8. [SOLVED] Count unique values among duplicates in a subtotal range
    By jcpotwor in forum Excel General
    Replies: 2
    Last Post: 01-12-2006, 09: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