transpose rows to combination of rows and columns

  • I've reviewed numerous posts on transposing data but none of them so far deal with a situation quite like this. I've attached a picture that hopefully describes what I'm trying to accomplish better than I can but I'll try; I have 1000's or rows of client account data containing user notes, 1 row for each note. The notes are typically a few sentences in length. Many accounts have numerous notes therefore the same client#/Acct# can appear many times in the data. I need to transpose the data so that each acct# appears only once and the notes are transposed horizontally beside the acct# according to the sequence of the "Other_#" in the column preceding the note. I've tried to show an example below using text as well.
    [ATTACH=CONFIG]53337[/ATTACH]


    INPUT


    CL_NO ACCT# OTHER NOTES
    89252 1 1000 Other_1 note1
    89252 1 1000 Other_2 note2
    89252 1 1001 Other_1 note1
    89252 1 1001 Other_2 note2
    89252 1 1001 Other_3 note3
    89237 1 1002 Other_1 note1
    89237 1 1002 Other_2 note2
    89237 1 1002 Other_3 note3
    89237 1 1002 Other_4 note4


    OUTPUT


    CL_NO ACCT# Other_1 Other_2 Other_3 Other_4 .....
    89252 1000 note1 note2
    89252 1001 note1 note2 note3
    89252 1002 note1 note2 note3 note4

  • Re: transpose rows to combination of rows and columns


    Try

  • Re: transpose rows to combination of rows and columns


    It's working but it keeps crashing. I've attached screenshots of the errors. Please note some of the user notes may consist of nothing but an asterisk, or sometimes just a period, or a line "===", or any other character, or sometimes nothing.[ATTACH=CONFIG]53400[/ATTACH][ATTACH=CONFIG]53401[/ATTACH]

  • Re: transpose rows to combination of rows and columns


    I have eXCEL 2007. When I manually delete the rows with blanks, #N/A, asterisks, "=", etc. it runs fine and copies data over/across 600 columns. Ex. "OTHER_650"

  • Re: transpose rows to combination of rows and columns


    Also, I notied about 100 entries where the user had entered "=========" and nothing else. It stops on all of those.

  • Re: transpose rows to combination of rows and columns


    Change

    Code
    If i > 1 Then b(.Item(txt), dic(a(i, 3))) = a(i, 4)


    to

    Code
    If i > 1 Then b(.Item(txt), dic(a(i, 3))) = "'" & a(i, 4)
  • Re: transpose rows to combination of rows and columns


    That fixed 99% of the issues. The only snag now is it halts when the cell contains #VALUE! (residue from some pre-processing before I receive the file)

  • Re: transpose rows to combination of rows and columns


    Treat them like the other rows if possible. i.e. Ignore the equals sign and move the text where it belongs based on the Other_# value.

  • Re: transpose rows to combination of rows and columns


    Change to

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!