+ Reply to Thread
Results 1 to 13 of 13

Returning data for Duplicates in correct order

  1. #1
    Registered User
    Join Date
    05-19-2013
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    40

    Returning data for Duplicates in correct order

    Hi Everyone,
    Simple question & can supply a test document if needed...but hopefully a description should be adequate.
    Column A...contains an ID for a task - appearing multiple times as you descend the column.
    Column B...a corresponding date at which each task has appeared or re-appeared - but which lookups to another worksheet where the data has been pulled from another source with successive columns containing manually-entered information.
    Using a standard vlookup obviously only pulls through the first date for each ID...I need each successive appearance to have it's appropriate date.
    (in columns c,d,e,f etc. I also have to pull data from the other sheet - again only pertaining to that particular instance of the ID occuring).
    As ever,any help appreciated

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,628

    Re: Returning data for Duplicates in correct order

    post the sample workbook please.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-19-2013
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Returning data for Duplicates in correct order

    I've added a file to make it a little clearer - thanks for responding.
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,628

    Re: Returning data for Duplicates in correct order

    Use the following Array Formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    committed with Ctrl-Shift-Enter rather than just Enter.

    It should look like this in the formula bar if it has been entered correctly:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    You could just use columns A and B but, in your test data, this does not return unique entries; A, B and C does.


    Regards, TMS

  5. #5
    Registered User
    Join Date
    05-19-2013
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Returning data for Duplicates in correct order

    Hi - thanks for your solution...I'm getting a circular reference error returned when I enter the array formula...?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,628

    Re: Returning data for Duplicates in correct order

    Please post the workbook with the CR. Thanks

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,628

    Re: Returning data for Duplicates in correct order

    I put the formula in cell G2 and in cell N2 (in sheet 2). Press Ctrl-Shift-Enter to commit. Then copy down.


    Regards, TMS

  8. #8
    Registered User
    Join Date
    05-19-2013
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Returning data for Duplicates in correct order

    I think I've not perhaps described what I'm after too clearly...
    Column A is all I have in Sheet 1 - Column B is looking for data in Sheet 2...then Columns C,D,E etc - all looking in Sheet 2.
    I'm therefore looking for an array formula to enter in cell B2 on Sheet 1 - to copy down to F21.
    Sorry if this wasn't clear.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,628

    Re: Returning data for Duplicates in correct order

    OK, I misunderstood.

    See if this helps. Note that the IDs on sheet2 need to be grouped together.


    Regards, TMS

  10. #10
    Registered User
    Join Date
    05-19-2013
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Returning data for Duplicates in correct order

    Thanks TMS - works beautifully...
    ...but raises the question(just out of interest) - can it be done with no alteration to the second sheet i.e. no grouping of IDs?

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,628

    Re: Returning data for Duplicates in correct order

    can it be done with no alteration to the second sheet i.e. no grouping of IDs?
    I suspect not.

    If you add a helper column on both sheets, then you can use a COUNTIF formula to add an "index" to the records. You can then use that index to match individual records. You might get away with just a helper column on Sheet2 and build the counter into the formula on Sheet1.

    But, either way, you have to alter Sheet 2.

    However, have a look at the reworked example, with and without a helper column on both sheets.

    The downside of adding the helper column or using a modified formula on Sheet1 is that they require Array Formulae. Consequently, if you have lots of rows and columns, it could get kind of slow. That is/was the advantage of the method originally demonstrated ... they are normal, if a little convoluted, formulae.


    Regards, TMS

  12. #12
    Registered User
    Join Date
    05-19-2013
    Location
    Chester, England
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Returning data for Duplicates in correct order

    Multiple solutions and some excellent advice.
    Very much appreciated.
    Regards again.

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,628

    Re: Returning data for Duplicates in correct order

    You're welcome. Thanks for the rep.

+ 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. Pull Data from multiple catagories and list under a new wksh, under correct order
    By greytgatsby in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-21-2011, 07:54 PM
  2. Displaying data in the correct order???
    By Rhett19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2011, 01:53 PM
  3. Formula sometimes returning correct answer and sometimes returning 0
    By redimp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2010, 06:28 AM
  4. Ranking in correct order
    By bluejie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-22-2008, 03:14 PM
  5. Re: UDF not returning correct information
    By keepITcool in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2005, 07:05 PM

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