+ Reply to Thread
Results 1 to 2 of 2

Sorting Duplicate Value Entries

  1. #1
    all4excel
    Guest

    Sorting Duplicate Value Entries

    I am attaching a file with Call-outs which explain the common problems faced during Sorting Duplicate values..
    I have two columns with name and Marks with Unsorted data.

    When i sort these columns , it works fine but when it encounters duplicate value it gives the same name twice..

    How do i overcome this ..

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try this array (Ctrl + Shift + enter)

    =INDEX($A$1:$A$16,MATCH(LARGE(($B$1:$B$16-ROW($B$1:$B$16)/10^5),ROWS(C$1:C1)),$B$1:$B$16-ROW($B$1:$B$16)/10^5,0))

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    all4excel
    Guest

    Thanx a lOt

    It really works , however i would apreciate if u could explain in details.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Does this help

    ROW($B$1:$B$16)/10^5 returns 0.00001

    So when it looks for Mel it returns 1010 - 0.00012 which is 1009.99988 e.g 1010 less row number 12 x 0.00001.

    So when it now looks at Cliff it returns 13 x 0.00001 again the row number to make a unique number

    So combined this will return the row which the index uses for the return

    the ROWS(C$1:C1)) increments by one when you drag down

    =MATCH(LARGE(($B$1:$B$16-ROW($B$1:$B$16)/10^5),ROWS(C$1:C1)),$B$1:$B$16-ROW($B$1:$B$16)/10^5,0)

    VBA Noob

  5. #5
    all4excel
    Guest

    Thank you so much for the explanation NOOb

    This is a good approcah to distinguish between same values by introducing an additional negligible value in the form of the ROW number.

+ 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