+ Reply to Thread
Results 1 to 6 of 6

organizing Column A, eliminating repeats, and transferring them to Columns B to xxxxx.....

  1. #1
    Registered User
    Join Date
    09-22-2014
    Location
    Huntsville, Alabama
    MS-Off Ver
    2013
    Posts
    3

    organizing Column A, eliminating repeats, and transferring them to Columns B to xxxxx.....

    So I don't know how quite to phrase the question. I think it's best to show with screen shots
    original data.JPG
    final data.jpg

    In the "original data" - obviously shorted for this question. You have Column A, which is a couple thousand rows long, but contains about 40 unique values. In Columns B you have your ID of interest. In Column C you have your genes.

    I want to reorganize Column A, such that every unique value is only represented once, and now occupies all of the columns. See "final data."

    So basically from the "original data," every CAP_001 with AA is placed under Column rs10037809. Every CAP_001 with TT is placed under Column rs10120572, and so on.

    To me, this doesn't seem possible in Excel. Any opinions? Thoughts on how this can be done without tedious cutting and pasting?

    I appreciate it!!!

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: organizing Column A, eliminating repeats, and transferring them to Columns B to xxxxx.

    I think that your problem is solvable in Excel but a workbook with data showing what you are starting with and what you want as a result will make helping you easier. A picture is nice but we can't work with them.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    09-22-2014
    Location
    Huntsville, Alabama
    MS-Off Ver
    2013
    Posts
    3

    Re: organizing Column A, eliminating repeats, and transferring them to Columns B to xxxxx.

    That's so true. Here's a mock up of the original data and final desired outcome.

    excel forum.xlsx

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: organizing Column A, eliminating repeats, and transferring them to Columns B to xxxxx.

    Here is an idea for you. I have created a new Sheet1 with a possible solution.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-22-2014
    Location
    Huntsville, Alabama
    MS-Off Ver
    2013
    Posts
    3

    Re: organizing Column A, eliminating repeats, and transferring them to Columns B to xxxxx.

    wow. Quite beyond my skills. Still not quite sure how to automate it. One of the biggest hurdles is getting SNP names from Column A to Columns B through XXXXX (in the original dataset, there are thousands of rows, but only a few hundred unique SNP names.

    So is the suggestion to eliminate duplicates, then transpose them, and THEN run your impressive formula? Because you obviously just copied and pasted the SNP name at the top of Column B, C, and D, correct? That task wouldn't be feasible with several thousand lines (most of which are repetitive, I think every 400 or so ID, the SNP name becomes a new name. So there needs to be a way to copy and paste AND reference AND tally the data in Columns A, B, C (from the original data).

    Your method is definitely a step above anything I could have come up with. I'm going to play around with the data some more.

    I appreciate the assistance a ton!

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: organizing Column A, eliminating repeats, and transferring them to Columns B to xxxxx.

    For the SNP names, I copied them to a blank space and then clicked on the Data tab, Remove Duplicates. Then using the results, I copied that and used Paste Transpose to get the column Names. This will work for your data.

    The formula in the worksheet that retrieved the data for the columns can be copied across as far as you like. The ranges in the formula would have to be increased to accommodate a large dataset.

    This is the formula for the first column change the 25 to a suitable value for your data. Do the same thing for the other formula:
    =IFERROR(INDEX(BEFORE!$B$2:$B$25,MATCH(1,INDEX((COUNTIF($A$1:A1,BEFORE!$B$2:$B$25)=0)*(BEFORE!$B$2:$B$25<>""),0),0)),"")

    =IFERROR(INDEX(BEFORE!$C$2:$C$25,MATCH(B$1&$A2,BEFORE!$A$2:$A$25&BEFORE!$B$2:$B$25,0)),"")

    Both of these formulae are entered with Ctrl + Shift + Enter
    Last edited by newdoverman; 09-22-2014 at 09:42 PM.

+ 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. Replies: 4
    Last Post: 01-26-2014, 05:48 PM
  2. Replies: 1
    Last Post: 06-14-2013, 04:06 PM
  3. Replies: 6
    Last Post: 12-09-2012, 09:00 PM
  4. if A column equal xxxxx, then select a range
    By AOL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2009, 08:35 PM
  5. Replies: 3
    Last Post: 07-04-2008, 07:42 PM

Tags for this Thread

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