+ Reply to Thread
Results 1 to 8 of 8

Find Unique Values Based On Multiple Columns

  1. #1
    Registered User
    Join Date
    07-21-2015
    Location
    West Midlands
    MS-Off Ver
    2010
    Posts
    43

    Find Unique Values Based On Multiple Columns

    Hi All,

    I have a dataset which has a list of clients that I am trying to find the unique records, based on a second column saying N, R, MTA or MTC, and a third column saying H or T. I have been able to do that within a formula as below, but the formula takes about 15 minutes to run on 1 cell, i have it on 4. As well as a variation on another 4 cells, is this something that can be done with VBA?

    =SUM(--(FREQUENCY(IF(Daybook!U:U<>"",IF(Daybook!AL:AL=$A4,MATCH(Daybook!U:U,Daybook!U:U,0))),ROW(Daybook!U:U)-ROW(Daybook!U2)+1)>0))

    Thank you
    Dustin

  2. #2
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Find Unique Values Based On Multiple Columns

    Dustin,

    Your problem is common and may be easily achieved with VBA code if you upload a workbook that includes a worksheet with your raw data and a worksheet with your desired results.
    <---If my answer helped, please click *

  3. #3
    Registered User
    Join Date
    07-21-2015
    Location
    West Midlands
    MS-Off Ver
    2010
    Posts
    43

    Re: Find Unique Values Based On Multiple Columns

    Sorry to sound stupid but I've tried to attach a document and cant seem to, is there a set way I have to do that?

  4. #4
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Find Unique Values Based On Multiple Columns

    Attaching a document did seem to be a bit challenging when I first attempted it on this forum. I promise you it can be done. I'd check the FAQs on that, or try again later with a fresh look at it. I believe it's under the Go-Advanced button when you reply. Then you need to upload it, and it seems to upload to a folder -- probably for virus protection purposes -- and then you can choose to attach it inline.

  5. #5
    Registered User
    Join Date
    07-21-2015
    Location
    West Midlands
    MS-Off Ver
    2010
    Posts
    43

    Re: Find Unique Values Based On Multiple Columns

    Hi,

    Im not sure if this has attached but if it has...

    Apologies for the late reply, on the attached I would like the code to fill in the Test_Sheet tab, even if you could provide code for just one of the cells I should be able to manipulate to match the rest of the data.

    So BA in Daybook is for Clients and BB is for Policies.

    Thank you
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Find Unique Values Based On Multiple Columns

    It is not clear at all to me what you actually want. If I go simply by your title "Find Unique Values Based On Multiple Columns" this will accomplish that.

    Please Login or Register  to view this content.
    Note: I doubt this will solve your real problem and I doubt you will be able to manipulate it to work for you. Try submitting a clear and concise description on what you want to accomplish. Anytime we have to guess or assume on a detail it means it probably will not work for your sheet.
    If you are happy with my response please click the * in the lower left of my post.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Find Unique Values Based On Multiple Columns

    It would probably help more if you gave a few sample answers, and, if needed, explain how you got them
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  8. #8
    Registered User
    Join Date
    07-21-2015
    Location
    West Midlands
    MS-Off Ver
    2010
    Posts
    43

    Re: Find Unique Values Based On Multiple Columns

    Hi,

    The only answers I have are from the formula in the original post, (I have amended below to take new column into account).

    =SUM(--(FREQUENCY(IF(Daybook!BA:BA<>"",IF(Daybook!AL:AL=$A4,MATCH(Daybook!BA:BA,Daybook!BA:BA,0))),ROW(Daybook!BA:BA)-ROW(Daybook!BA2)+1)>0))


    I don't have any sample answers in VBA as yet, but the formula checks number of unique values in BA which have "N" in AL (for clients). Then the same for policy but based on BB and AL. The only problem is the formula takes ages to run when I have the test sheet filled in and the full data in the Daybook tab.

    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: 3
    Last Post: 11-14-2015, 03:48 PM
  2. [SOLVED] Find count of Unique or Duplicate Values based on Concatenated values in 2 columns
    By bdicarlo1 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-03-2014, 12:42 AM
  3. [SOLVED] Find Common Values across multiple sheets based on Unique ID
    By desibabuji in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-12-2014, 05:38 PM
  4. Find unique values between 2 columns
    By will_a in forum Excel General
    Replies: 1
    Last Post: 11-06-2013, 02:57 PM
  5. Replies: 2
    Last Post: 02-06-2013, 04:44 AM

Tags for this Thread

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