+ Reply to Thread
Results 1 to 8 of 8

Consolidating data that varies down rows

  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    Jackson, MS
    MS-Off Ver
    Excel 2010
    Posts
    7

    Consolidating data that varies down rows

    I'm in the process of trying to build a contact database to import into a CRM, and the best way we can figure to do this since our contacts weren't kept in any manner is to export using our online product delivery system. Essentially what that spits out is a list of email address, names, customer name, their document (product) and the quantity they purchased it.

    When I query and export this data from our delivery system, for each document (product) the customer purchased, it basically duplicates the customer data down into new rows. What I would like to do is find a way to pull all the document (product) information onto the same line so I can import and use the product as a tag. The downside is that there isn't consistency in how many rows the data spans per customer. So, for example you might have one customer that only purchased one product, and thus only takes up one row. Then you have a customer who purchased 1 product multiple times, or multiple products. That customers information takes up 2+ rows. The only consistency is that the line that ends the individual customer information has the email address and "total" beside it.

    Is there a macro or way I could create a macro to essentially look at the email address, and for each email address that matches, move the next line of data up so that all data with the same email address is on one row, rather than down columns.

    I've attached a mock data sheet to show you essentially what my data looks like if that is helpful.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Consolidating data that varies down rows

    What do you mean by "move all the data up"? Can you mock up an expected output sheet based on the input you provided? Also not sure what you want done with the Total rows, so a visualization would really help.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Consolidating data that varies down rows

    I changed the data range to a table, only because tables know how big they are. I also added a helper column to test if a line is a total line (ends in "Total"). Then I made a pivot table of it. Is this the direction in which you would like to go?
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Registered User
    Join Date
    03-28-2013
    Location
    Jackson, MS
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Consolidating data that varies down rows

    Hi, thanks for the response. I've attached an example 2 to show what I could image that looking like. My ultimate goal, what I'd like to end up with is all customer data on one row. So, instead of having 5 rows of customer purchase data have it all on one row, just spread out across columns. Does that make sense? I'm trying to find a way that I can combine all of the products a customer has purchased into one cell so that I can use that as tags.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-28-2013
    Location
    Jackson, MS
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Consolidating data that varies down rows

    Hi dflak, thanks for the response. Not really, I'd like to get all of that document (product) information into the same field in the end, on the same line as the customer. So, rather than a customer having 5 rows of data if they bought 5 products, have one row per customer with all the document (product) information in one field.

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Consolidating data that varies down rows

    See if this is on the right track. A revised pivot table and some code to read it and make a string out of it.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-28-2013
    Location
    Jackson, MS
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Consolidating data that varies down rows

    YES! That is exactly what I would want. Two quick changes: Can it bring back the first name field, last name field (rather than full name), and email address? Also, to deploy this will I just grab the macro and run it in my actual document? THANK YOU!

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Consolidating data that varies down rows

    Same idea, a bit of recoding.

    Copy and paste the data into sheet 1, refresh the pivot table, run the macro.

+ 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. insert rows and copy data across sheets - row quantity varies each time
    By Herbo76 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2016, 10:48 AM
  2. [SOLVED] Consolidating rows of data
    By jeck876 in forum Excel General
    Replies: 18
    Last Post: 08-05-2015, 09:55 AM
  3. Consolidating Rows of Data
    By khalloran in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-17-2014, 06:07 PM
  4. Consolidating Rows of Data
    By Camel in forum Excel General
    Replies: 1
    Last Post: 01-19-2013, 04:29 AM
  5. Consolidating data across multiple rows
    By mrtrick8586 in forum Excel General
    Replies: 1
    Last Post: 02-22-2011, 11:09 AM
  6. Help Consolidating Data from multiple rows
    By souljive99 in forum Excel General
    Replies: 2
    Last Post: 06-10-2009, 06:34 AM
  7. Consolidating data from multiple rows in one row
    By darX in forum Excel General
    Replies: 1
    Last Post: 03-04-2009, 06:51 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