+ Reply to Thread
Results 1 to 13 of 13

Advanced columns to rows with example attached

  1. #1
    Registered User
    Join Date
    02-15-2013
    Location
    Gambier, OH
    MS-Off Ver
    Excel 2011 for Mac Version 14.4.3
    Posts
    10

    Advanced columns to rows with example attached

    I have a file (example attached) that has a column with names, followed by a column containing that person's contact information, followed by a column with that person's rank. The names are listed as "Last, First MI" and have from 0 to 4 blank cells beneath them depending on how much contact information is included for each individual. The contact info never has an empty cell, but they are listed in the same order as long as that information is provided (Address, "City, ST ZIP", Email, Home Phone, Cell Phone), and the rank is in cells the same way as the names. Each new name is in the cell on the column to the left of it's first address information and the column to the right shows their rank. Any additional address information has blank cells to its right and left.

    There are about thousands rows of this, with about 1500 names. I need this information to be listed in the following manner (if possible):

    First Name/Last Name/MI/Address/City/State/ZIP/Email/Home Phone/Cell Phone/Rank

    I have been able to do this by copying everything into Word, where it is all listed separated by ^p. I then change each ^p into a ^t as long as it's not followed by a ^#.^#^# (which is how the ranks are formatted). But with this, the address information and ranks go into random columns depending on how much address info was included for that individual.

    My example includes how I have the information now and how I would like it to be listed. I appreciate any feedback. I am not very good with macros, but will figure it out if that is the best way to solve this issue.

    Thank you in advance for taking the time to read through this.
    Attached Files Attached Files
    Last edited by nandaopira; 02-15-2013 at 12:42 PM. Reason: revised title

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Advanced columns to rows with example attached

    nandaopira,

    Welcome to the Excel Forum.

    Thanks for the workbook.

    However, we can not accurately work with the data you posted.

    Can we see the actual raw data, say, for 10 to 20 names,,,,,,,, with sensitive data changed?
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    02-15-2013
    Location
    Gambier, OH
    MS-Off Ver
    Excel 2011 for Mac Version 14.4.3
    Posts
    10

    Re: Advanced columns to rows with example attached

    Hello stanley,

    Thank you for taking the time to look at my workbook. I am attaching another workbook with 20 names. All of the names and contact info have been altered, but should resemble the original. There is one additional difference in this workbook; it has a column that numbers each name. I have included from number 6 to number 25, but the original has a little under 1600 names. It is not important to have the numbers included in the outcome. It would be nice to have the rankings included, but not completely necessary.

    I really appreciate your help! I only have to do this about two to three times each year and have figured out multiple formulas that if done in the right sequence work reasonably well, but would very much appreciate a formula or macro that would get this done quickly. If the solution is a macro, please help me with some instructions on how to use it as I am not very familiar with macros.

    Again, thank you all for taking the time to help me out with this.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Advanced columns to rows with example attached

    nandaopira,

    Thanks for the latest workbook.

    Your first workbook contained three columns of raw data - the newest workbook contains four columns of raw data????

    Can we have another workbook with the raw data in the first worksheet (left most sheet in he tabs view), and another sheet with the titles in row 1, and with the first example from the first worksheet, manually entered by you for the results you are looking for.

  5. #5
    Registered User
    Join Date
    02-15-2013
    Location
    Gambier, OH
    MS-Off Ver
    Excel 2011 for Mac Version 14.4.3
    Posts
    10

    Re: Advanced columns to rows with example attached

    Hi Stan,

    Thank you for your response. I'm sorry about that extra column, it is not necessary and can be deleted. I forgot to include it in the first example because I typed it in by hand.

    New example included:
    Sheet 1 - Raw data as I have it.
    Sheet 2 - Title in Row 1, first example as I would like to have it.
    Sheet 3 - Title in Row 1, all 20 examples as I would like to have it.

    Please let me know if this is what you were asking for, and if you need anything else.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Advanced columns to rows with example attached

    nandaopira,

    In your latest workbook, Sheet3 (results) the first and last names are not in the correct title column?????

    B1 = First Name, C1 = Last Name
    B2 = Moore, C2 = Linda

  7. #7
    Registered User
    Join Date
    02-15-2013
    Location
    Gambier, OH
    MS-Off Ver
    Excel 2011 for Mac Version 14.4.3
    Posts
    10

    Re: Advanced columns to rows with example attached

    You're right, Stan. That was an oversight on my part. Those titles should be reversed:
    B1 = Last Name
    C1 = First Name

    Thanks for pointing that out.

  8. #8
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Advanced columns to rows with example attached

    nandaopira,

    I assume that the raw data is in the first worksheet (left most worksheet in the display for the tabs/worksheets).

    The below macro works correctly based on the raw data that you supplied.

    The macro will create a new worksheet Results to display the results you are looking for.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


    Please Login or Register  to view this content.

    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm


    Then run the ReorgData macro.

  9. #9
    Registered User
    Join Date
    02-15-2013
    Location
    Gambier, OH
    MS-Off Ver
    Excel 2011 for Mac Version 14.4.3
    Posts
    10

    Re: Advanced columns to rows with example attached

    That worked like magic, Stan! Well done, and thank you so much! I really appreciate your help.

  10. #10
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Advanced columns to rows with example attached

    nandaopira,

    Thanks for the feedback.

    You are very welcome. Glad I could help.

    Come back anytime.

  11. #11
    Registered User
    Join Date
    02-15-2013
    Location
    Gambier, OH
    MS-Off Ver
    Excel 2011 for Mac Version 14.4.3
    Posts
    10

    Re: Advanced columns to rows with example attached

    Hello Stan,

    A small problem came up. A new user entered their information without including their zip code. With this, the macro is returning a "subscript out of range" error message. Is there a solution to this? Could I have an issue if other data is left out (such as "city" or "ST")?

    Let me know if I need to provide you with another example. I could do a find/replace and change letters and numbers around for the entire worksheet to safeguard sensitive data.

    I am going away for work until Sunday, so will not be quite as responsive this week, but would appreciate any help you could give me.

    Thanks again for your help.

    Fernando

  12. #12
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Advanced columns to rows with example attached

    nandaopira,

    Please supply another workbook containing several examples of "A new user entered their information without including their zip code".

  13. #13
    Registered User
    Join Date
    02-15-2013
    Location
    Gambier, OH
    MS-Off Ver
    Excel 2011 for Mac Version 14.4.3
    Posts
    10

    Re: Advanced columns to rows with example attached

    Hello Stan,

    I am sorry it has taken so long to respond. Thank you for the willingness to help. I am attaching the latest example. In order to change the contact names and info I just ran multiple find/replace. I don't think it changed the basic nature of any of the information.

    Once again, thank you for your help.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    02-15-2013
    Location
    Gambier, OH
    MS-Off Ver
    Excel 2011 for Mac Version 14.4.3
    Posts
    10

    Re: Advanced columns to rows with example attached

    Hello Stan,

    Please let me know if you are willing to help me tweak this macro once again. I have been able to get it to work sometimes, but there are occasions where some information is missing and it will not work. I am a college swim coach and recruiter and this is the most comprehensive list we are able to get, but we have a difficult time organizing the athletes because it is not formatted well.

    I can send you any information you may need in a timely fashion.

    Thank you,
    Fernando

+ 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