+ Reply to Thread
Results 1 to 5 of 5

Remove duplicate and blank with formula

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    italy
    MS-Off Ver
    Excel 2003
    Posts
    2

    Remove duplicate and blank with formula

    Hello, I need to create a formula to extract data from a table, depending on two parameter.
    I use two combo to select parameters, but I need to have into combo only different values, without blank space.

    Into attached file the example problem, I want to remove duplicate from Data1 and shows into List1 and select values from Data2, removing blank and shows into List2.

    Ending... I don't want to use Macro.

    Any suggestions?
    Thanks a lot
    Attached Files Attached Files
    Last edited by ssimo2; 01-16-2013 at 03:41 PM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Remove duplicate and blank with formula

    hi ssimo2, welcome to the forum. try this array formula in H2:
    Please Login or Register  to view this content.
    you have to paste the formula inside the formula bar & press CTRL + SHIFT + ENTER

    change all range A2:A8 to B2:B8 when you want to use it in N2

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Remove duplicate and blank with formula

    In H2 (and copied down):

    =IF(ROW(A1)>SUM(--(MATCH($A$2:$A$8,A:A,0)=ROW($A$2:$A$8))),"",INDEX(A:A,LARGE(INDEX(IF(MATCH($A$2:$A$8,A:A,0)=ROW($A$2:$A$8),ROW($A$2:$A$8)),0),SUM(--(MATCH($A$2:$A$8,A:A,0)=ROW($A$2:$A$8)))-(ROW(A1)-1))))

    This is an array formula and must be entered with Ctrl-Shift-Enter, not just enter.

    Likewise, in N2:

    =IF(ROW(A1)>SUM(--(MATCH($B$2:$B$8,B:B,0)=ROW($B$2:$B$8))),"",INDEX(B:B,LARGE(INDEX(IF(MATCH($B$2:$B$8,B:B,0)=ROW($B$2:$B$8),ROW($B$2:$B$8)),0),SUM(--(MATCH($B$2:$B$8,B:B,0)=ROW($B$2:$B$8)))-(ROW(A1)-1))))

    Also confirmed with Ctrl-Shift-Enter

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Remove duplicate and blank with formula

    A non-arrayed approach;
    First I created two keys (col F and G which can be hidden later) to count and uniquely identify values in col A and B. For example in F2 copied down;

    =IF(COUNTIF($A$2:A2,A2)=1,"D1_"& COUNTIF($F$1:F1,"D1*")+1,"")

    Then in I2 copied down (pulls values from A based on identifiers in F)

    =IF(ISERROR(MATCH("D1_"&ROW(A1),$F$2:$F$8,0)),"",INDEX($A$2:$A$8,MATCH("D1_"&ROW(A1),$F$2:$F$8,0)))
    See attachment
    Attached Files Attached Files
    Last edited by ChemistB; 01-16-2013 at 11:08 AM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    01-10-2013
    Location
    italy
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Remove duplicate and blank with formula

    Thanks a lot to all, I've solved using formula suggested by benishiryo!

    Moreover, to dinamically select data into list2, according to selection in list1, i've added a column to show only right values.

    Attached the result file.

    Thanks to all!
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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