+ Reply to Thread
Results 1 to 7 of 7

Combining One Record w Multiple Rows into One Row Multiple Columns

  1. #1
    Registered User
    Join Date
    02-21-2018
    Location
    USA
    MS-Off Ver
    Excel For Mac 15.40
    Posts
    3

    Combining One Record w Multiple Rows into One Row Multiple Columns

    Hello,
    I'm trying to determine the easiest way to combine a single record with multiple rows of similar data into a single row record.

    For instance the input is:

    PWNUM CSTNAME UPC01 US Retail SKU01
    2 STAY PUFT ONESIE 883028153824 19.99 687706
    2 STAY PUFT ONESIE 883028170500 19.99 689209
    2 STAY PUFT ONESIE 883028153831 19.99 687707

    I'd like the output to be:

    PWNUM CSTNAME UPC01 UPC02 UPC03 US Retail SKU01 SKU02 SKU03
    2 STAY PUFT ONESIE 883028153824 883028170500 883028153831 687706 689209 687707


    Thank you,
    Jeff

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Combining One Record w Multiple Rows into One Row Multiple Columns

    Not saying I will solve this but the answer to this question may help others.

    Will there ALWAYS be 3 rows combined into 1 row or could there be more/less than 3 ?

    This looks like a job for VBA
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Combining One Record w Multiple Rows into One Row Multiple Columns

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    02-21-2018
    Location
    USA
    MS-Off Ver
    Excel For Mac 15.40
    Posts
    3

    Re: Combining One Record w Multiple Rows into One Row Multiple Columns

    I can't post any links or files until I post a few more times. Is there a work around?



    The records are not always 3 rows. There are some constants that are shared and then some data changes like size, sku, upc, etc.

    Basically I'm trying to combine all the information under one record, by PWNUM, so that each PWNUM is listed only once. So that it will eventually look like this.


    I used to complete this task with a script in filemaker pro, but my company is no longer supporting this application and I am trying to find a means to accomplish it in Excel.

    Thank you.

  5. #5
    Registered User
    Join Date
    02-21-2018
    Location
    USA
    MS-Off Ver
    Excel For Mac 15.40
    Posts
    3

    Re: Combining One Record w Multiple Rows into One Row Multiple Columns

    Ok I figured out it out after rereading your post. I have attached and original data the way I get it and the merged data.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Combining One Record w Multiple Rows into One Row Multiple Columns

    Too much data and not enough explanation!! I have taken one of your sheets (assuming that it is your raw data - you didn't really explain what was what) and radically cut it down to being a SAMPLE. In your initial post, each PWNUM has ONE CSTNAME. that is not the case (see shaded cells). How do you want these to be treated.
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Combining One Record w Multiple Rows into One Row Multiple Columns

    I've taken a bit of a guess at this:

    A2, copied down:
    =IFERROR(INDEX(Raw!$A$2:$A$25,MATCH(0,INDEX(COUNTIF($A$1:$A1,Raw!$A$2:$A$25),0),0)),"")

    B2,copied down:
    =IFERROR(VLOOKUP(A2,Raw!A:B,2,FALSE),"")

    c2,copied across and down (array formula):
    =IFERROR(IF($A2="","",INDEX(Raw!$C$2:$C$25,SMALL(IF((Raw!$A$2:$A$25=$A2),ROW(Raw!$A$2:$A$25)-1),COLUMNS($C$2:C2)))),"")

    G2, copied down similar to B2

    H2 copied across and down, similar to C2.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

+ 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. Combining multiple rows into multiple columns
    By Jeppers in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-15-2017, 07:33 AM
  2. [SOLVED] Combining Multiple Rows in Multiple Columns
    By jbaillie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-12-2016, 03:50 PM
  3. Combining multiple rows from 2 columns into sorted columns depending on 1st columns value
    By Dexamphetamine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-11-2013, 10:00 AM
  4. [SOLVED] Combining Multiple Columns to Create Multiple Rows in Macro
    By TacoBrew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2013, 04:26 PM
  5. Turning Multiple Columns for a Record Into Multiple Rows
    By BeeZeRCoX in forum Excel General
    Replies: 4
    Last Post: 08-16-2012, 02:12 AM
  6. Combining Multiple Rows into a Single Record
    By civic1 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-30-2007, 09:14 PM
  7. combining multiple rows into 1 record
    By ccrydr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-14-2006, 02:55 PM

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