Hello all,
I have an excel sheet with several thousand lines that presents like:
Apple Orange Banana
John 1 2 0
Trish 2 3 0
I would like to change it to:
John Apple 1
John Orange 2
John Banana 0
Trish Apple 2
Trish Orange 3
Trish Banana 0
Is this possible? Thanks in advance for your help.
Last edited by bbratcher; 03-15-2010 at 03:48 PM.
Assuming you are entering the data in row 2:
Change the -2 to the number of the row of your first output line.Code:=OFFSET($A$1,INT((ROW()-2)/3)+1,0) & " " & OFFSET($A$1,0,MOD(ROW()-2,3)+1) & " " & OFFSET($A$1,INT((ROW()-2)/3)+1,MOD(ROW()-2,3)+1)
Change the 3 to the number of header lines.
Change the $A$1's to the upper left corner of your table.
=OFFSET($A$1,INT((ROW()-2)/3)+1,0) & " " & OFFSET($A$1,0,MOD(ROW()-2,3)+1) & " " & OFFSET($A$1,INT((ROW()-2)/3)+1,MOD(ROW()-2,3)+1)
Works like a charm Mdbct! Thanks a million.
Can I then separate each component into a cell by themselves?
Sure. Put each Offset into it's own column.
Name
FruitCode:=OFFSET($A$1,INT((ROW()-2)/3)+1,0)
ValueCode:OFFSET($A$1,0,MOD(ROW()-2,3)+1)
Code:OFFSET($A$1,INT((ROW()-2)/3)+1,MOD(ROW()-2,3)+1)
Many, many thanks! Works perfectly.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks