+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    03-15-2010
    Location
    Jackson, Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    3

    Column Headers to Column Data

    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.

  2. #2
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    843

    Re: Column Headers to Column Data????

    Assuming you are entering the data in row 2:
    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 -2 to the number of the row of your first output line.
    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)

  3. #3
    Registered User
    Join Date
    03-15-2010
    Location
    Jackson, Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Column Headers to Column Data

    Works like a charm Mdbct! Thanks a million.

    Can I then separate each component into a cell by themselves?

  4. #4
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    843

    Re: Column Headers to Column Data

    Sure. Put each Offset into it's own column.

    Name
    Code:
    =OFFSET($A$1,INT((ROW()-2)/3)+1,0)
    Fruit
    Code:
    OFFSET($A$1,0,MOD(ROW()-2,3)+1)
    Value
    Code:
    OFFSET($A$1,INT((ROW()-2)/3)+1,MOD(ROW()-2,3)+1)

  5. #5
    Registered User
    Join Date
    03-15-2010
    Location
    Jackson, Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Column Headers to Column Data

    Many, many thanks! Works perfectly.

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.2.0