+ Reply to Thread
Results 1 to 21 of 21

Can I move data from rows into columns?

  1. #1
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Can I move data from rows into columns?

    I have a file with three column headers ORGANIZATION, EVENT CODE, and AMOUNT. There are 19 rows, with six different organizations and seven different event codes. I want to move the event codes and amounts to the same row as the organization, adding extra columns for the different event codes. (See attached file for clarification.) The file has two worksheets, one called "I HAVE" and one called "I WANT". The first is what my data looks like, the second is what I need.

    I've tried a few different things, but I can't figure it out. I was leaning towards SUMIF, but not sure how to do that with so many columns.

    Can someone please help?

    Thanks in advance, much appreciated!
    Sari

    HELP 1.xlsx

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Can I move data from rows into columns?

    Hi, welcome to the forum

    If you already have the row and column headings, put this in sheet 2 B2, and copy down and across as needed...
    =IFERROR(INDEX('I HAVE'!$C$2:$C$20,MATCH('I WANT'!$A2&'I WANT'!B$1,INDEX('I HAVE'!$A$2:$A$20&'I HAVE'!$B$2:$B$20,0),0)),"")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Oh my goodness! You're amazing! Thank you so much!!!

  4. #4
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Hmm... there seems to be a problem. In my example sheet 'I HAVE', see how for Org B there are five donations for LN2013? Well, the formula seems to only be including the first one. Is there a way around that?

    Thanks in advance!

  5. #5
    Forum Contributor
    Join Date
    06-18-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    142

    Re: Can I move data from rows into columns?

    Try
    Please Login or Register  to view this content.
    in Cell B2 on the I WANT sheet...copy across and down as needed.

    Does that work?

  6. #6
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Yes, that worked perfect! Thank you so much for your help!

    I've added more info to my example... can you tell me how to do it now please? Again, I have the two sheets, 'I HAVE' and 'I WANT'.

    Thanks so much!

    Sari

    HELP 2.xlsx

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Can I move data from rows into columns?

    with a pivot table.

    see the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  8. #8
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Thanks. What about if I have 500 IDs, names and addresses on sheet1, and 50 IDs and names on sheet2. I need the addresses to be filled in on sheet2. I can use the ID to match them. What formula would I use for this?

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Can I move data from rows into columns?

    I apreciate is you reply if my pivot table solution is usefull.

    Answer to your question use index / match.

  10. #10
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Pivot Table would work if I knew how to use it. I lost my addresses so now I need to fill them in. I tried index/match and it didn't work when I copied the formula down.

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Can I move data from rows into columns?

    in which file did you tried that?

    post an example on the forum.

  12. #12
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    I tried in io my working file. I don't have time to convert it to an example that doesn't show sensitive data.

    Thanks for your help... but I'm still stuck.

  13. #13
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Quote Originally Posted by jjhayes View Post
    Try
    Please Login or Register  to view this content.
    in Cell B2 on the I WANT sheet...copy across and down as needed.

    Does that work?
    This worked exactly as I wanted it to... but when I tried it on a different sheet, the formula only worked in one column and not the rest...? I can't see why. Can you please help?

    Thanks in advance.HELP 3.xlsx

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Can I move data from rows into columns?

    I did not notice you had multiple entries, sorry. Try this instead...
    =SUMIFS('I HAVE'!$C$2:$C$20,'I HAVE'!$A$2:$A$20,'I WANT'!$A2,'I HAVE'!$B$2:$B$20,'I WANT'!B$1)

  15. #15
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Can I move data from rows into columns?

    Try this on your new file...
    =SUMIFS(ORGANIZATIONS!$D:$D,ORGANIZATIONS!$B:$B,$B2,ORGANIZATIONS!$C:$C,ORGANIZATIONS!C$2&"*")

  16. #16
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Quote Originally Posted by FDibbins View Post
    Try this on your new file...
    =SUMIFS(ORGANIZATIONS!$D:$D,ORGANIZATIONS!$B:$B,$B2,ORGANIZATIONS!$C:$C,ORGANIZATIONS!C$2&"*")
    hmmm... that gives me $395 in C2 (which is correct), but it also gives me $395 in E2, F2, G2, etc. There should only be $395 in that row.

  17. #17
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Can I move data from rows into columns?

    try this...
    =SUMIFS(ORGANIZATIONS!$D$2:$D$21,ORGANIZATIONS!$A$2:$A$21,$A2,ORGANIZATIONS!$C$2:$C$21,C$1&"*")

    Note also that a few of your headings on sheet2 have a O ("oh") instead of 0 (zero)

  18. #18
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Thanks again, so much for your help with this!

    I have another question, something that seems like it should be so simple, but I cannot figure it out. I have 500 IDs, names and addresses on sheet1, and 50 IDs and names on sheet2. I need the addresses from sheet1 to be filled in on sheet2, assuming that the 50 on sheet2 do appear and match IDs on sheet1. So basically I just want to grab info from column C based on a match in column A, and have it appear in a new cell on sheet2.
    I tried index and match, but coudln't figure it out. I tried replace and substitute. I don't know how to do this.

    Please help. Thanks so much in advance!

  19. #19
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Quote Originally Posted by jjhayes View Post
    Try
    Please Login or Register  to view this content.
    in Cell B2 on the I WANT sheet...copy across and down as needed.

    Does that work?
    Thanks again, so much for your help with this!

    I have another question, something that seems like it should be so simple, but I cannot figure it out. I have 500 IDs, names and addresses on sheet1, and 50 IDs and names on sheet2. I need the addresses from sheet1 to be filled in on sheet2, assuming that the 50 on sheet2 do appear and match IDs on sheet1. So basically I just want to grab info from column C based on a match in column A, and have it appear in a new cell on sheet2.
    I tried index and match, but coudln't figure it out. I tried replace and substitute. I don't know how to do this.

    Please help. Thanks so much in advance!

  20. #20
    Forum Contributor
    Join Date
    06-18-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    142

    Re: Can I move data from rows into columns?

    I think the following would work. I will try to check this thread again tomorrow.

    Please Login or Register  to view this content.
    Let's assume you want the addresses in column D on your Sheet2 and the IDs are in Column A on Sheet2 (IDs are in Column A of Sheet 1 and addresses are in Column C of sheet 1), then paste the above in D1 and copy down.

    Would need to be modified in the above assumptions aren't correct.

  21. #21
    Registered User
    Join Date
    09-11-2015
    Location
    Vancouver, BC, CANADA
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Can I move data from rows into columns?

    Quote Originally Posted by jjhayes View Post
    I think the following would work. I will try to check this thread again tomorrow.

    Please Login or Register  to view this content.
    Let's assume you want the addresses in column D on your Sheet2 and the IDs are in Column A on Sheet2 (IDs are in Column A of Sheet 1 and addresses are in Column C of sheet 1), then paste the above in D1 and copy down.

    Would need to be modified in the above assumptions aren't correct.
    FANTASTIC!!! Exactly what I was looking for! I was able to get it with VLOOKUP, but then I had to change the column number with each new column, which is annoying. Your solution is much better! Thank you!

+ 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. Move data from columns to rows
    By kennylj54 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2015, 01:48 PM
  2. [SOLVED] Move data on duplicate rows (different columns) to one row and delete extra rows?
    By Sagwa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 08:25 AM
  3. Replies: 1
    Last Post: 12-18-2013, 05:31 PM
  4. Move data in rows to columns
    By hfler in forum Excel General
    Replies: 2
    Last Post: 07-14-2008, 12:32 PM
  5. Move Blocks Of Data In Columns To Rows
    By phillim in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2008, 03:27 PM
  6. [SOLVED] how do I move data in prexisting rows to columns?
    By darryl in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-15-2006, 05:15 AM
  7. Move Data from rows to columns...
    By Dan B in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-06-2006, 12:50 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