+ Reply to Thread
Results 1 to 11 of 11

Convert matrix into column data

  1. #1
    Registered User
    Join Date
    03-22-2013
    Location
    newcastle
    MS-Off Ver
    Excel 2010
    Posts
    7

    Convert matrix into column data

    Hello,

    Can anyone help me to convert matrix data anto column format. My data formatted as below.

    Region 11/11/11 11/12/12 11/01/13 etc +50 columns

    Scotland £50 £10 £5
    England £150 0 £12
    Ireland £30 £15 0

    etc +200 rows

    And would like to make into columns like:


    Scotland 11/11/11 £50
    Scotland 11/12/12 £10
    Scotland 11/01/13 £5
    England 11/11/11 £150
    England 11/12/12 0
    England 11/01/13 £12 .....

    Is it achievable?? Help

    Thank you in advance.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Convert matrix into column data

    attach a sample file with current and desired table
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    03-22-2013
    Location
    newcastle
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Convert matrix into column data

    Hello,

    Now test file attached.

    Thank you.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Convert matrix into column data

    The output in sheet2
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-22-2013
    Location
    newcastle
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Convert matrix into column data

    Hi Ab33,

    That was a test file and actual file has 1200 rows and 69 columns. Is there any method/ formula/ function you used to made it into output sheet2?

    Thanks,

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Convert matrix into column data

    There is a code attached with the book. While at excel do the following
    Alt+F8 will take to the actual code. It is called Module that is where the code is stored.
    Or click developer then visual basics is also the same.
    While you are at module, you hit F5, or from the menu above click run, then press to run.
    The code should cope with any amount of data. The only thing you need to watch is "Currentregion" You should not have a whole column, or row empty in the input data, but can easily change.
    To run the code in your actual data:
    If you sheet names are different to sheets1 and 2, change them. If you are not sure, I will do it for you.

  7. #7
    Registered User
    Join Date
    03-22-2013
    Location
    newcastle
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Convert matrix into column data

    Hello AB33,

    Thank you for your help. However as I have not much knowledge on VBs etc my result is coming up different I think. I attached one of the actual files, could you perform convertion, please and what do I need to do if want to keep it as an template for future. Please advice.

    Thank you
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Convert matrix into column data

    Please check the attached and if you are happy with it, I will make it a bit flexible.
    I have change the output sheet. When You run the code, the output does not have to be any sheet name, but the code adds new name itself.
    Attached Files Attached Files
    Last edited by AB33; 03-22-2013 at 11:05 AM.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Convert matrix into column data

    I have also added a button on sheet1 column AG, so when you want to re-run the code, just click the button

  10. #10
    Registered User
    Join Date
    03-22-2013
    Location
    newcastle
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Convert matrix into column data

    It works like a magic. Thank you.

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Convert matrix into column data

    Misheel,
    You are welcome!
    If you have any issue, PM me.
    Could you please now close (Mark) this thread as solved? Go in to the top right-hand side of this page, choose "Thread Tools" from the menu, then select "solved" from the drop down menu.

+ 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