+ Reply to Thread
Results 1 to 7 of 7

Changing certain columns from vertical to horizontal?

  1. #1
    Registered User
    Join Date
    08-06-2007
    Posts
    6

    Question Changing certain columns from vertical to horizontal?

    I just started a new project where I work. I have pretty basic excel skills but have been given a very daunting excel task. Please see the attached files. All the columns E-I that are of the same date need to be listed horizontally in the row across that date. I was wondering if there is a quicker way to do this other than copy pasting each line as the document has 65536 rows and this is only last names A-J. Thanks for any help.
    Attached Images Attached Images

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by cpcg32
    I just started a new project where I work. I have pretty basic excel skills but have been given a very daunting excel task. Please see the attached files. All the columns E-I that are of the same date need to be listed horizontally in the row across that date. I was wondering if there is a quicker way to do this other than copy pasting each line as the document has 65536 rows and this is only last names A-J. Thanks for any help.
    Hi,

    it is easier to test if you attach a sample worksheet rather than a .jpg.

    In sets of 5, and assuming that row 1 has column headings:

    in J2 put =IF(AND($D2<>$D1,$B2=$B3,$C2=$C3,$D2=$D3),E3,"")

    and formula fill right 4 columns

    in O2 put =IF(AND($D2<>$D1,$B2=$B4,$C2=$C4,$D2=$D4),E4,"")

    and formula fill right 4 columns

    in T2 put =IF(AND($D2<>$D1,$B2=$B5,$C2=$C5,$D2=$D5),E5,"")

    and formula fill right 4 columns

    and follow the pattern as far as the number of duplicates requires.

    then bulk-formula fill O2:IV2 down to row 65536

    formula fill is discussed at http://www.mvps.org/dmcritchie/excel/fillhand.htm

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    If you do a dummy column in column J that has a counting formula as such that will tell you what instance it is of the same person/date. Then you just need to find the highest date/person instance (i.e. John Doe 6/12/07 has 14 entries)

    Count Formula in column J as follows (assuming headers in row 1):
    =SUMPRODUCT(--($A$2:$A2=$A2),--($B$2:$B2=$B2),--($D$2:$D2=$D2))
    Once this is done calculating I highly recommend copying and pasting as values so it doesn't try to recalculate all of this agian.

    Then whatever information you need to have copied in you would setup headers for those (assume that the column header for E is TimeCode and F is TimeDesc)

    Enter your headers on column K-?? for the max number of itterations (i.e. 14 from the example above). If possible add a single row on top of the spreadsheet above the headers (if not possible move a single row to another worksheet for now)
    In the new row 1, above the first iteration headers put 1, above the second 2, etc.

    Now in Cell K3 you can enter this formula
    =INDEX($E$1:$I$65536,SUMPRODUCT(--($A$1:$A$65536=$A3),--($B$1:$B$65536=$B3),--($D$1:$D$65536=$D3),--($J$1:$J$65536=A$1),ROW($A$1:$A$65536)),MATCH(K$2,$E$2:$I$2,0))

    Copy and paste that all the way down from all your itterations of headers.
    Go eat lunch, build a model airplane, travel around the world, go on vacation. Possibly when you do all of that when you get back the formulas will have calculated, you can copy-paste as values and then just sort column J and delete everything but 1's.

    Seriously though, my solution will work, but sumproduct gets very boggy with tons of data like that. I'd suggest macros, but my skill at doing them isn't very good.

  4. #4
    Registered User
    Join Date
    08-06-2007
    Posts
    6
    Thanks for the help so far, here is a sample of the spreadsheet.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by cpcg32
    Thanks for the help so far, here is a sample of the spreadsheet.
    You appear to have not put in the formula, Formula Fill can be seen at http://www.mvps.org/dmcritchie/excel/fillhand.htm

    hth
    ---
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-06-2007
    Posts
    6
    Sorry, that was just a couple of the original. I (and my boss) really appreciate the help so far. I am now wondering what the best the way to remove the lines once they have been moved is?

  7. #7
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by cpcg32
    Sorry, that was just a couple of the original. I (and my boss) really appreciate the help so far. I am now wondering what the best the way to remove the lines once they have been moved is?
    Hi,

    after you have setup the formula for as many sets as required,and filled down the data, then select columns J to however far (as much as you used) and Copy, then Paste Special = Values to set the values in place.

    In a spare column, (say Z) in Z2 put =IF(AND(A2=A1,B2=B1,D2=D1),"del","")
    and formula fill that down the data rows, then

    put headers on row 1 and Data, Filter, Autofilter

    On column Z, select the dropdown and select the deletes

    Select and delete all of the rows dispayed.

    Remove the filter

    Of course, save a copy before you start deleting.

    hth
    ---

+ 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