+ Reply to Thread
Results 1 to 35 of 35

Data Challenge: turning massive amounts of sales order data into summarized customer data

  1. #1
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Data Challenge: turning massive amounts of sales order data into summarized customer data

    I have a lot of data (over 674,000 rows) by 8 columns but am struggling to figure out how to work it into the data I need. There are very simple formulas for what I need (counts, if statements, averages, etc) but I can't figure out how to execute them without a ton of manual work. Further complicating matters is that each customer has a variety of orders (some have 1 others have thousands).

    Attached you will find a subset of the data on Tab 1 "Data" (4 customers, 188 rows) as well as what I would like the output to be on Tab 2 "Desired" (empty rows separating customers are not necessary as I will be using vlookups to arrange the data further). If you have any idea how to do this I would greatly appreciate your feedback.

    Thank you!
    Andy
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    The formulas in the attached file should work, but you would need to remove the "Total" lines.
    Here is a link with a quick way to delete those rows: http://chandoo.org/wp/2013/03/15/rem...c-value-excel/

    The other option would be to add a condition to EVERY formula that ignores the total lines: Data!b$2:b$189,"<>"&"Total"
    Attached Files Attached Files
    Please click the * icon below if I have helped.

  3. #3
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    The "Order of *" formulas were not correct.
    The attached file should fix that.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Thank you very much Melvinrobb - the formulas seem to work well and I very much appreciate the quick response. Only part I'm still trying to figure out is how best to apply this to the much larger data set - i.e. how will I duplicate everything in the "desired" tab for 20,000+ customers?

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Hi amiller,

    Here's a custom routine for a lot of rows

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  6. #6
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Wow xladept, this looks pretty impressive but I have no idea how to use it. Guess I'll be doing some research on custom routines. Thank you

  7. #7
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    The way I would complete the "desired" tab is by copying the list of customers, pasting and removing duplicates. Then copy the new list and past it below 5 times. Then sort, and you will have a group of 6 for each customer. paste the formulas for the first six lines (which should be the first customer), and drag down.

  8. #8
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Thanks again - I'll give that a try. Much appreciated!

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Hi amiller,

    I think I can make it even faster - but it should be pretty quick as it is

    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.

    Open a macro-enabled Workbook or save your Workbook As Macro-Enabled

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name


    Then you need to have your Data-Desired book active!

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Hi,

    This is as fast as I can make it, but for 640K rows, you might need the speed

    Please Login or Register  to view this content.
    Last edited by xladept; 04-02-2013 at 03:39 PM.

  11. #11
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    working great but I made an error in my initial desired requirements: actually need the following data:
    # of Orders
    Avg Order Size
    Orders < $99
    Orders of $100-$199
    Orders of $200-$499
    Orders of $500+

    if you have time to tweak your formulas, that would be a big help - I'm trying now as well but am struggling with making the ranges inclusive

  12. #12
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    I made some changes to my original file, so here are the steps to follow:
    1. Paste the unique "Account #s" in N3 (The formulas are set up for at most 30,000 accounts)
    2. Highlight cells B2:J10 and drag down

    Let me know if the formulas I constructed are working correctly.

    I recommend dragging down B2:B10 down, then C2:c10, etc.... copy and pasting values after each column is complete, and saving EVERY time. These formulas are referencing over 600000 rows, and having a large number of them will slow down excel quite a bit, to the point of possibly crashing.
    Attached Files Attached Files

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    The solution to get lists for columns A and B looks pretty easy to do. Use these formulae in column C2 to C8 copy across:

    =SUMIF(Data!$A:$A,$A2,Data!C:C)
    =COUNTIFS(Data!$A:$A,$A2,Data!C:C,">0")
    =IFERROR(AVERAGEIFS(Data!C:C,Data!$A:$A,$A2),0)
    =COUNTIFS(Data!$A:$A,$A2,Data!C:C,"<=99")
    =COUNTIFS(Data!$A:$A,$A2,Data!C:C,"<=199")
    =COUNTIFS(Data!$A:$A,$A2,Data!C:C,"<=499")
    =COUNTIFS(Data!$A:$A,$A2,Data!C:C,">=500")

    Then just select C2:H8 and copy then paste beside each account group.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  14. #14
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Thanks again Melvinrobb - you are awesome!

  15. #15
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    thank you newdoverman, problem is I've got over 25,000 groups and various amounts of data sets for each but I think I've got it figured out due to other contributor's help.

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Hi amiller,

    Here's the new version fully tweaked

    Please Login or Register  to view this content.
    Last edited by xladept; 04-02-2013 at 08:59 PM.

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Duplicate Post
    Last edited by xladept; 04-02-2013 at 07:59 PM.

  18. #18
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Formulas are working great, only problem is how long it takes my computer to process dragging the formulas down. Thanks again

  19. #19
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    That's great. It definitely will be quite slow. Drag one column down, copy-paste values, save, and then drag the next one down. Limiting the numbers of formulas that are active is the key.

  20. #20
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Hi amiller,

    That's the trouble with formulas all over the spreadsheet - when you open the sheet, it has to do all those calculations - I think that there is a definite time advantage in the VBA routine I wrote for you??????

  21. #21
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    You would probably be better off if you used a database program for this instead of Excel. Unless you have a very fast computer, this will be like driving spikes with a small tack hammer.

  22. #22
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    I'm sure you are correct xladept - I'm just so unfamiliar with VBA routines that when the other solution was working, I decided to go with it. That said, I may have to give it another try as muscling through with the formulas is proving to be time prohibitive. Thanks again.

  23. #23
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Hi amiller,

    Yeah - I think it could run in less than 5 seconds, please let me know how long it actually takes - this code is more like a 28 oz maul than a little tack hammer

  24. #24
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    xladept - you are a stud; as you predicted, it worked flawlessly in about 5 seconds! Only tweak I had to make was the names of the order size labels to be consistent with the changes I requested, luckily I was able to figure that much out without bugging you again.

    I knew Excel was powerful but this was certainly an eye opener - thank you very much for taking the time to walk me through this.

    Melvinrobb - thank you again as well, you definitely had a solution that worked but I think we can both learn a lot from xladept's expertise.

  25. #25
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Great! You're welcome! Glad to hear that my timing estimate was reasonable

  26. #26
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Last edited by xladept; 01-15-2014 at 06:45 PM.

  27. #27
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Here's what I got: EForum Example2.xlsx

  28. #28
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Worked like a charm - I just needed to include subtotals.

    Thanks again xladept!

  29. #29
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Worked like a charm - I just needed to include subtotals.

    Thanks again xladept!

  30. #30
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    You're welcome!

  31. #31
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    xladept - if you're up for another challenge, I've got a couple more wrinkles to add:

    1) change the order size criteria to the following:
    Orders </= $0
    Orders of $0-$25 (greater than $0 and less than $25)
    Orders of $25-$50 (greater or equal to $25 and less than $50)
    Orders of $50-$99 (greater or equal to $50 and less than $99)
    Orders of $100-$200 (greater or equal to $100 and less than $200)
    Orders of $200-$500 (greater or equal to $200 and less than $500)
    Orders >/= $500

    2) the more challenging request - in addition to pulling the count of orders in each size criteria, also report the sum of those orders (i.e. if there are 3 orders over $500: <$1000, $1,500, $1,300>; a value of $3,800 would be reported, ideally in the column just to the right of the count for each)

    If wrinkle #2 is very cumbersome to include as part of the initial script, it could be written as a separate script and I could combine the data. I was hoping to find a "countif" that I could replace with "sumif" in your original script but obviously that's not how these things work.

    amiller
    Last edited by amiller; 01-16-2014 at 04:50 PM.

  32. #32
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Hi,

    I'll take a look tomorrow

  33. #33
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Hi AMiller,

    Try this:

    Please Login or Register  to view this content.

  34. #34
    Registered User
    Join Date
    04-07-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Somehow I missed this on Friday - again, it worked perfectly. Thanks a ton!

    You've inspired me to sign up for an advanced Excel course after demonstrating how powerful these scripts can be.

    Cheers,
    Andy

  35. #35
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Data Challenge: turning massive amounts of sales order data into summarized customer d

    Hi Andy,

    You're welcome!

    BTW - Let me know if the course actually addresses these kind of issues.

+ 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