+ Reply to Thread
Results 1 to 14 of 14

3 column data into 1 column data by adding rows.

  1. #1
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    3 column data into 1 column data by adding rows.

    Hi,

    Hope someone can help!

    I have a C.4000 line list of data in 3 separate columns.
    There are SKU numbers which are split into x3 types; "simples", "configs" & "grouped".

    I need to find a way of taking the raw 3 column data & putting it into a single column however it needs to be in a specific order.

    It needs to run;
    simples
    configs
    grouped
    simples
    config
    grouped
    simples
    config
    grouped
    etc.
    etc.

    The prefix for all the simples, configs & grouped are all the same, the suffix is different depending on the 'type'.

    I've attached an example of the raw data + the end data (+ colour coded to make is easier to see what I'm trying to achieve).

    I just don't know how to get from the raw data to the end data!

    Ideally this needs to be a formula not a macro.

    I hope I've made myself clear but please fire away any questions.

    Thank you!!!
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: 3 column data into 1 column data by adding rows.

    You could probably do this using a few helper columns. I'll take a more detailed look at it tomorrow.

    Pete

  3. #3
    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,938

    Re: 3 column data into 1 column data by adding rows.

    I get kind of what you want by just copying each set, 1 below the other, into a new column, then sorting them. It puts the blue 1st, then the pink followed by green, in each "category
    G
    2
    SC-HD-3420-STN_CON
    3
    SC-HD-3420-STN_GRP
    4
    SC-HD-3420-STN-L
    5
    SC-HD-3420-STN-M
    6
    SC-HD-3420-STN-S
    7
    SC-HD-3420-STN-XL
    8
    SC-HD-3420-STN-XS
    9
    SC-HD-3420-STN-XXL
    10
    SC-HD-3424-SGE_CON
    11
    SC-HD-3424-SGE_GRP
    12
    SC-HD-3424-SGE-L
    13
    SC-HD-3424-SGE-M
    14
    SC-HD-3424-SGE-S
    15
    SC-HD-3424-SGE-XL
    16
    SC-HD-3424-SGE-XS
    17
    SC-HD-3424-SGE-XXL
    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

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: 3 column data into 1 column data by adding rows.

    Select data A2:C65 & define name as "DATA"
    Enter formula in "E2" [Array formula : shift+ctrl+enter]
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copy down


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  5. #5
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: 3 column data into 1 column data by adding rows.

    Thanks FDibbins but your solution isn't exactly what I'm trying to achieve.
    Firstly is needs to run, green then blue then pink.
    Also the green need to be the the specific order they started in; XS, S, M, L, XL, XXL
    Therefore filtering by sort order doesn't work as it jumbles them to L, M, S, XL, XS, XXL.
    Also sort ordering isn't using a formula.

    Thanks.
    Last edited by matthew_salter; 06-02-2017 at 03:59 AM. Reason: amended comment

  6. #6
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: 3 column data into 1 column data by adding rows.

    Quote Originally Posted by avk View Post
    Select data A2:C65 & define name as "DATA"
    Enter formula in "E2" [Array formula : shift+ctrl+enter]
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copy down
    Thanks Avk but unless I'm doing something wrong it's not working.

    I understand how to Select data A2:C65 & define name as "DATA".
    I also understand how to create an array formula {=IFERROR(INDEX(Data,1+INT((ROW(A2)-1)/COLUMNS(Data)),MOD(ROW(A2)-1+COLUMNS(Data),COLUMNS(Data))+1),"")}

    This isn't however giving me the data I need.

    My data should end up as follows;

    SC-SO-3902-PNK-XS
    SC-SO-3902-PNK-S
    SC-SO-3902-PNK-M
    SC-SO-3902-PNK-L
    SC-SO-3902-PNK-XL
    SC-SO-3902-PNK-XXL
    SC-SO-3902-PNK_CON
    SC-SO-3902-PNK_GRP
    SC-HD-3424-SGE-XS
    SC-HD-3424-SGE-S
    SC-HD-3424-SGE-M
    SC-HD-3424-SGE-L
    SC-HD-3424-SGE-XL
    SC-HD-3424-SGE-XXL
    SC-HD-3424-SGE_CON
    SC-HD-3424-SGE_GRP
    SC-HD-3486-BLK-XS
    SC-HD-3486-BLK-S
    SC-HD-3486-BLK-M
    SC-HD-3486-BLK-L
    SC-HD-3486-BLK-XL
    SC-HD-3486-BLK-XXL
    SC-HD-3486-BLK_CON
    SC-HD-3486-BLK_GRP

    Using the formula you suggested I get this;
    SC-SO-3902-PNK_CON
    SC-SO-3902-PNK_GRP
    SC-SO-3902-PNK-S
    SC-HD-3424-SGE_CON
    SC-HD-3424-SGE_GRP
    SC-SO-3902-PNK-M
    SC-HD-3486-BLK_CON
    SC-HD-3486-BLK_GRP
    SC-SO-3902-PNK-L
    SC-JG-3432-SGE_CON
    SC-JG-3432-SGE_GRP
    SC-SO-3902-PNK-XL
    SC-JG-3487-BLK_CON
    SC-JG-3487-BLK_GRP
    SC-SO-3902-PNK-XXL
    SC-TS-3880-ONG_CON
    SC-TS-3880-ONG_GRP
    SC-HD-3424-SGE-XS
    SC-JN-3542-BLK_CON
    SC-JN-3542-BLK_GRP
    SC-HD-3424-SGE-S
    SC-JN-3913-LGHTD_CON
    SC-JN-3913-LGHTD_GRP
    SC-HD-3424-SGE-M

    Have I missed something?

  7. #7
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: 3 column data into 1 column data by adding rows.

    Quote Originally Posted by Pete_UK View Post
    You could probably do this using a few helper columns. I'll take a more detailed look at it tomorrow.

    Pete
    Hi Pete_UK,

    Yeah I was thinking a helper column might be the answer but I wasn't sure how to do this with different suffixes on each SKU or across multiple columns of data trying to convert into one single column in the right order.

    If you have any suggestions, great!

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: 3 column data into 1 column data by adding rows.

    The attached file produces the output that you require, but I have used five helper columns, all coloured blue.

    The first helper is in column D, and this gives a unique identifier to each record in column A by adding a sequential number to the end of the SKU, following an underscore. This formula should be copied down at least to the bottom of the list that you have in column A, although I tend to copy a few rows further.

    Column E produces a count of the number of records that exist in column A for each group that are shown in columns B/C, and column F shows the cumulative count, with column G also showing the cumulative count, but adding 2 extra on to each cumulative sum to account for the "configs" and "groups" rows that will be needed. It is important to have zero in F1 and G1, and the formulae in E:G only need to be copied down for as many records as you have in columns B/C (as before, I've copied a few rows further in the attached file).

    Column H shows the row in columns B/C where the Prefix for the record can be located, and this is duplicated for as many records are needed (including the configs and group records). Finally, the formula in column I will reproduce the data in a single column in the order that you desire. The formulae in columns H and I will need to be copied down for as many rows as the highest number given in column G, though you can copy further to ensure that you have all the data. I have moved your original END DATA column to J, so that you can compare the results directly.

    Hope this helps.

    Pete
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: 3 column data into 1 column data by adding rows.

    Quote Originally Posted by Pete_UK View Post
    The attached file produces the output that you require, but I have used five helper columns, all coloured blue.

    The first helper is in column D, and this gives a unique identifier to each record in column A by adding a sequential number to the end of the SKU, following an underscore. This formula should be copied down at least to the bottom of the list that you have in column A, although I tend to copy a few rows further.

    Column E produces a count of the number of records that exist in column A for each group that are shown in columns B/C, and column F shows the cumulative count, with column G also showing the cumulative count, but adding 2 extra on to each cumulative sum to account for the "configs" and "groups" rows that will be needed. It is important to have zero in F1 and G1, and the formulae in E:G only need to be copied down for as many records as you have in columns B/C (as before, I've copied a few rows further in the attached file).

    Column H shows the row in columns B/C where the Prefix for the record can be located, and this is duplicated for as many records are needed (including the configs and group records). Finally, the formula in column I will reproduce the data in a single column in the order that you desire. The formulae in columns H and I will need to be copied down for as many rows as the highest number given in column G, though you can copy further to ensure that you have all the data. I have moved your original END DATA column to J, so that you can compare the results directly.

    Hope this helps.

    Pete
    Hi Pete_UK,
    Sorry for the later reply.
    I saw you'd commented on my other thread.

    I'm still trying to get this bit to work and was certainly going to come back to you with my thanks once I'd got it working.

    It certainly looks as if your solution will work however the example I gave in this thread was a very 'slimmed down' version of what I'm actually trying to achieve.
    I posted a 'slimmed down' version to try to make it easier to understand the problem however the final spread sheet is far more complex.

    The actual spread sheet I'm working on has loads & loads of column data that I'm trying to transpose from one worksheet into another in the specific order like my example.


    For your info this is the whole problem...

    We are running x2 separate software systems in our business.
    The first piece of software is what we use to raise purchase orders & follow production with our factories.
    The second piece of software is magento (not sure if you now it), which we use to run our consumer web sites.
    There are A LOT of products and I need to find a way to export the raw data from our purchase orders, convert this in the right format & create a mass product import for our magento web sites.

    There are x4 sheets in my master excel sheet.
    'raw data' - This is the raw data as it's exported from our production software.
    'summary sheet' - This is a list of data we cannot export from the production software but needs to be manually entered per product in order for the import to work.
    'workings' - This sheet that takes all the raw data & summary sheet data, combines it into the right formats.
    'export to csv' - This is the final sheet (this is the one my thread relates to), this needs to take the 'workings' sheet data & transpose it into the 'export to csv' sheet ready for import into magento.

    Inside the 'workings' sheet you will see there are actually x6 groups of column data (each group containing 30 columns).
    I've colour coded them in a similar way to the example I gave in my thread.
    I then need to use the formula's you've kindly helped with to transpose not just the x3 columns of data in my example but (6x30) 180 columns of data from the 'workings' sheet, into the 'export to csv' sheet in the right order.

    For this example I've simply copied & pasted the data into the 'export to csv' sheet so you can see the final order the data needs to be in.


    It's a complex task I'm sure you'd agree!


    p.s. regards my other threads.
    I have other problems inside the 'workings' sheet which I also need to fix and don't know how to do it.
    Therefore I started x2 other threads to try to solve these issues.

    Thank you for your time!

    The file is too large to attach to this thread, therefore see this dropbox link if you wanted to take a look;
    https://www.dropbox.com/s/hgbyd0xrt4...load.xlsx?dl=0

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: 3 column data into 1 column data by adding rows.

    Thanks for the more detailed explanation, Matthew. Many contributors are unwilling (or not allowed due to company firewalls etc.) to download files from 3rd party sites, so perhaps you can zip the file and see if that will attach here (or save it as an .xlsb format).

    I think your requirements, though, go beyond what you might reasonably expect to get a solution for on a site which offers free advice and guidance, so you might get more responses if you submit the post to Commercial Services, using the link at the top of the screen. It strikes me that a VBA solution will be needed here, given the volume of data, and I am not in a position to offer any help in that direction.

    Pete

  11. #11
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: 3 column data into 1 column data by adding rows.

    Quote Originally Posted by matthew_salter View Post
    Hi Pete_UK,
    Sorry for the later reply.
    I saw you'd commented on my other thread.

    I'm still trying to get this bit to work and was certainly going to come back to you with my thanks once I'd got it working.

    It certainly looks as if your solution will work however the example I gave in this thread was a very 'slimmed down' version of what I'm actually trying to achieve.
    I posted a 'slimmed down' version to try to make it easier to understand the problem however the final spread sheet is far more complex.

    The actual spread sheet I'm working on has loads & loads of column data that I'm trying to transpose from one worksheet into another in the specific order like my example.


    For your info this is the whole problem...

    We are running x2 separate software systems in our business.
    The first piece of software is what we use to raise purchase orders & follow production with our factories.
    The second piece of software is magento (not sure if you now it), which we use to run our consumer web sites.
    There are A LOT of products and I need to find a way to export the raw data from our purchase orders, convert this in the right format & create a mass product import for our magento web sites.

    There are x4 sheets in my master excel sheet.
    'raw data' - This is the raw data as it's exported from our production software.
    'summary sheet' - This is a list of data we cannot export from the production software but needs to be manually entered per product in order for the import to work.
    'workings' - This sheet that takes all the raw data & summary sheet data, combines it into the right formats.
    'export to csv' - This is the final sheet (this is the one my thread relates to), this needs to take the 'workings' sheet data & transpose it into the 'export to csv' sheet ready for import into magento.

    Inside the 'workings' sheet you will see there are actually x6 groups of column data (each group containing 30 columns).
    I've colour coded them in a similar way to the example I gave in my thread.
    I then need to use the formula's you've kindly helped with to transpose not just the x3 columns of data in my example but (6x30) 180 columns of data from the 'workings' sheet, into the 'export to csv' sheet in the right order.

    For this example I've simply copied & pasted the data into the 'export to csv' sheet so you can see the final order the data needs to be in.


    It's a complex task I'm sure you'd agree!


    p.s. regards my other threads.
    I have other problems inside the 'workings' sheet which I also need to fix and don't know how to do it.
    Therefore I started x2 other threads to try to solve these issues.

    Thank you for your time!

    The file is too large to attach to this thread, therefore see this dropbox link if you wanted to take a look;
    https://www.dropbox.com/s/hgbyd0xrt4...load.xlsx?dl=0
    Hi Pete_UK,

    Do you think this is something you can help with.
    I'm completely stuck.

    You're solution was perfect, but I've been trying all afternoon to turn what you came up with into something I can use across multiple columns & rows.

    If not, no problem & thank you anyway!

  12. #12
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: 3 column data into 1 column data by adding rows.

    I just posted immediately before you - I've been out in the garden all day.

    Pete

  13. #13
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: 3 column data into 1 column data by adding rows.

    Quote Originally Posted by Pete_UK View Post
    I just posted immediately before you - I've been out in the garden all day.

    Pete
    Ah yes, our messages crossed paths.

    I fully understand it goes beyond 'free' advise, no problem, I'll try commercial.

    I really had hoped to avoid VBA as editing in the future (with my reasonable, yet limited) knowledge then becomes a problem for me.

    If it's the only solution then will have to look into it.

    The file isn't letting me upload. It's 2.4Mb even for compresses.

    Thank you anyway, I'll have to contact commercial.

  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,938

    Re: 3 column data into 1 column data by adding rows.

    Mathew please don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding

    For normal conversational replies, try using the QUICK REPLY box below.

+ 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. Find Rows of Specified Data within Column and Output Data from Next Column Over
    By mlexcelhelpforum in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2013, 05:50 PM
  2. Help for adding static date in column B on import/pasting of data in Column A
    By Parijaat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2013, 05:34 AM
  3. Replies: 4
    Last Post: 06-08-2012, 03:24 PM
  4. Replies: 4
    Last Post: 10-31-2011, 04:33 PM
  5. Adding Column B, when Column A has specific data
    By foto4cash in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-05-2011, 01:36 PM
  6. Replies: 2
    Last Post: 07-20-2009, 08:52 PM
  7. Replies: 5
    Last Post: 07-09-2008, 10:12 AM

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