+ Reply to Thread
Results 1 to 4 of 4

Looking for a way to filter out duplicates and sort entries

  1. #1
    Registered User
    Join Date
    10-31-2018
    Location
    NJ, USA
    MS-Off Ver
    2016
    Posts
    7

    Question Looking for a way to filter out duplicates and sort entries

    Hello Everyone,

    I will try to describe this as best as I can, but I find it difficult to explain.

    I have a few columns of interest here:
    Column B is Chemical Identifier Numbers
    Column N is a category based on the use of them chemical (ranging 1-12 but excluding 8 and 11)
    Column K is the percentage of use that is reported.

    Right now I have written a formula that calculated the maximum value from Row K based on the numbers in row B and N.

    =MAX(IF(B$2:B$87959=B2, IF(N$2:N$87959=N2, K$2:K$87959)))

    and that output is located in Column O. Now I want to find a way to cut the excess and organize my sheet.

    Here is an example of what it looks like now. You can see that for the material 123-45-6789, it has multiples in Column N but the values in column O are the same due to the formula I inputted above

    _____B________N_____O

    123-45-6789____4____0.5%
    123-45-6789____4____0.5%
    123-45-6789____3____0.1%
    123-45-6789____4____0.5%
    123-45-6789____1____0.09%
    123-45-6789____4____0.5%
    123-45-6789____2____0.35%
    123-45-6789____2____0.35%
    123-45-6789____4____0.5%
    123-45-6789____5____0.41%
    123-45-6789____5____0.41%
    123-45-6789____5____0.41%
    123-45-6789____6____0.29%
    123-45-6789____4____0.5%
    123-45-6789____3____0.1%
    123-45-6789____5____0.41%
    123-45-6789____4____0.5%
    123-45-6789____6____0.29%

    And this is what I am hoping to get.

    All new columns here
    123-45-6789____1____0.09%
    123-45-6789____2____0.35%
    123-45-6789____3____0.1%
    123-45-6789____4____0.5%
    123-45-6789____5____0.41%
    123-45-6789____6____ 6 0.29%

    Is there any way to do this?
    Last edited by mauralts; 01-23-2019 at 04:39 PM.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: Looking for a way to filter out duplicates and sort entries

    if they were all side by side then it would be easy using the remove duplicates function. Is the data in between cols B and N necessary? If not you could still use the remove duplicates under the data tab. Have you considered that?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    10-31-2018
    Location
    NJ, USA
    MS-Off Ver
    2016
    Posts
    7

    Re: Looking for a way to filter out duplicates and sort entries

    The issue is that I need multiples for row B and for row N, but want to exclude the additional multiples. Like I want to be able to say that when Row B = x, keep the one instance of 1-6 in column N and then filter out the rest. And then the same when B = y.

    The finished product would look like:

    123-45-6789____1____0.09%
    123-45-6789____2____0.35%
    123-45-6789____3____0.1%
    123-45-6789____4____0.5%
    123-45-6789____5____0.41%
    123-45-6789____6____ 6 0.29%
    222-465-69_____1_____0.39%
    222-465-69_____2_____0.256%
    222-465-69_____3_____0.31%
    222-465-69_____4_____0.742%
    222-465-69_____5_____0.00%
    222-465-69_____6_____0.08%

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Looking for a way to filter out duplicates and sort entries

    This proposal employs three helper columns which may be moved and or hidden for aesthetic purposes.
    Note that the data starts on row 2.
    Column P is populated using: =COUNTIFS(B3:B$38,B2,N3:N$38,N2)=0
    Column R is populated using: =IFERROR(INDEX(B$1:B$37,AGGREGATE(15,6,ROW($1:$37)/($P$1:$P$37),ROW(1:1))),"")
    Column S is populated using: =IF(R2="","",IF(R2<>R1,1,IF(OR(S1+1=8,S1+1=11),S1+2,S1+1)))
    The filtered table (columns U:AI) is populated using: =IFERROR(INDEX(A$1:A$37,AGGREGATE(15,6,ROW($1:$37)/($B$1:$B$37=$R2)/($N$1:$N$37=$S2),1)),"")
    If this doesn't resolve the issue please upload a sample spreadsheet that is representative of the actual data (without sensitive information) as well as the output that would be expected based on that data.
    To upload a sample spreadsheet click on the GO ADVANCED button below the Quick Reply windown and then scroll down to Manage Attachments to open the upload window.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Using filter to highlight/filter duplicates in multiple columns but within 1 day
    By DaveBre in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2014, 04:07 AM
  2. Replies: 13
    Last Post: 05-11-2014, 06:51 PM
  3. Replies: 5
    Last Post: 12-19-2013, 06:58 AM
  4. [SOLVED] Removing all entries that are NOT duplicates
    By scottlin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-16-2013, 09:28 AM
  5. [SOLVED] Filter - Hiding duplicates but displaying 1 of the duplicates item
    By blacky1 in forum Excel General
    Replies: 3
    Last Post: 04-19-2012, 07:43 AM
  6. Database Duplicates and Most Recent Entries!
    By hfourxzeror in forum Excel General
    Replies: 2
    Last Post: 06-04-2010, 01:42 PM
  7. sort and remove duplicates macro causing unique entries to vanish
    By excellentexcel in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-24-2009, 04:58 PM

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