+ Reply to Thread
Results 1 to 4 of 4

merge data from array without removing column duplicates

  1. #1
    Registered User
    Join Date
    09-26-2007
    Posts
    2

    merge data from array without removing column duplicates

    Hello,

    I am looking for help (worksheet function or VBA code) that will automate the following.

    I have a data array in which the first column contains duplicates. For example these 3 columns with 4 entries, 2 of which are entries for Susan who has both a work and home number:

    NAME NUMBER TYPE
    Susan 3456 home
    Andre 4321 work
    Susan 6789 work
    Keith 5432 cell

    I want to transform/merge the data as follows, in this case to 4 columns with three entries:

    NAME HOME WORK CELL
    Susan 3456 6789 -----
    Andre 4321 ----- -----
    Keith ----- ----- 5432

    Any help is appreciated. Thanks.
    Last edited by VBA Noob; 09-26-2007 at 12:29 PM.

  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
    Maybe a pivot.

    See attachment and link

    http://www.datapigtechnologies.com/f...es/pivot1.html

    VBA Noob
    Attached Files Attached Files
    _________________________________________


    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
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517
    Quote Originally Posted by aversluis

    NAME NUMBER TYPE
    Susan 3456 home
    Andre 4321 work
    Susan 6789 work
    Keith 5432 cell

    I want to transform/merge the data as follows, in this case to 4 columns with three entries:

    NAME home work cell
    Susan 3456 6789 -----
    Andre 4321 ----- -----
    Keith ----- ----- 5432
    Assuming this is in Cells A1:C5 of Sheet1 and your final list is in Cells A1:D4 of Sheet2;
    Set cell B2 of Sheet 2 to:
    {=INDEX(Sheet1!$B$2:$B$5,MATCH($A2&B$1,Sheet1!$A$2:$A$5&Sheet1!$C$2:$C$5,0))}
    Note that this is an ARRAY formaula so use CTRL SHIFT ENTER rather than just ENTER.

    ALSO note that you MUST ensure that the entries are all spelt exactly the same way in both sheets with the same capitalisation etc.

    Mark.

  4. #4
    Registered User
    Join Date
    09-26-2007
    Posts
    2

    Cool Thanks!

    You've solved my problem!

+ 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