+ Reply to Thread
Results 1 to 7 of 7

Combining multiple rows from 2 columns into sorted columns depending on 1st columns value

  1. #1
    Registered User
    Join Date
    07-08-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Combining multiple rows from 2 columns into sorted columns depending on 1st columns value

    Hi all,
    Working on FDA adverse events database and have several Gig of excel files (from ASCII) that I am trying to sort and combine.
    Basically Column A has the identifier and Column B the adverse event. Each identifier can have multiple adverse events.
    I wish to convert the data such that there is only 1 identifier and each adverse event is listed across the columns.
    Attached is a sample from the file that I am working with.
    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-08-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Combining multiple rows from 2 columns into sorted columns depending on 1st columns va

    BTW - please do not be scared off by my username... Have used it for years - previously a pharmacist that dispensed considerable amounts for various conditions.

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Combining multiple rows from 2 columns into sorted columns depending on 1st columns va

    Hi,

    If I understand you correctly, then, based on your attachment, this array formula (confirm with CTRL+SHIFT+ENTER, not just ENTER) in cell C2 and copied down until you start to see blanks will give you a list of identifiers with duplicates removed:

    =IFERROR(INDEX($A$2:$A$100,SMALL(IF(FREQUENCY(MATCH($A$2:$A$100,$A$2:$A$100,0),ROW($A$2:$A$100)-MIN(ROW($A$2:$A$100))+1),ROW($A$2:$A$100)-MIN(ROW($A$2:$A$100))+1),ROWS($1:1))),"")

    Then, this formula in cell D2 and copied down and to the right, again until you start to see blanks and again array-entered:

    =IFERROR(INDEX($B$2:$B$100,SMALL(IF($A$2:$A$100=$C2,ROW($A$2:$A$100)-MIN(ROW($A$2:$A$100))+1),COLUMNS($A:A))),"")

    P.S. I wasn't scared off by your username (though thanks for the clarification! )

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Combining multiple rows from 2 columns into sorted columns depending on 1st columns va

    Try the attached.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-08-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Combining multiple rows from 2 columns into sorted columns depending on 1st columns va

    Thank you to both responders. The solutions work just as a require and saved me a great deal of time - there is no way I could have come up with these solutions. Also thanks for the very prompt replies!

  6. #6
    Registered User
    Join Date
    04-22-2013
    Location
    pune,india
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Combining multiple rows from 2 columns into sorted columns depending on 1st columns va

    I am a retired person,trying to learn excel.These kind of equations frighten me no end.what are you? some kind of Einstein?

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Combining multiple rows from 2 columns into sorted columns depending on 1st columns va

    @abkundargi

    They really aren't that frightening, you know , and I'd be happy to break them down and try to explain them if you want.

    Regards

+ 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. [SOLVED] Combining Like Items Across Multiple Columns/Rows?
    By softserve in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-08-2013, 02:06 PM
  2. formula for combining multiple dates, from columns to rows
    By juliomanco in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-29-2012, 06:21 PM
  3. [SOLVED] Multiple columns to individuals columns by sorted column
    By wildlifeduke in forum Excel General
    Replies: 4
    Last Post: 07-27-2012, 05:05 PM
  4. sorting two columns and write the sorted values on two columns in a different sheet
    By virsojour in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-22-2010, 04:38 AM
  5. Combining Data... Multiple Rows and Columns.
    By MattGold in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2008, 10:58 AM

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