+ Reply to Thread
Results 1 to 6 of 6

Combine similar data from multiple sheets

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Combine similar data from multiple sheets

    I have a workbook with 4 sheets (call them Q1, Q2, Q3, Q4). Each sheet contains ~38,000 rows of data.

    I need to combine all 4 sheets into one single sheet, but in the process I need to combine similar data that occurs over all 4 sheets. Similar data would be all of the following being equal:
    1. Sales Rep Number
    2. Account Number
    3. Invoice Number

    For example (example 1)
    ............Sales Rep............Account Number..............Invoice Number..........Sales Amount
    Q1.......Mike....................12345...............................TX-EX34.....................10,000
    Q3.......Mike....................12345...............................TX-EX34.....................20,000
    Q4.......Mike....................12345...............................TX-EX34.....................50,000

    After combining data, I would have one single line as follows:
    ............Sales Rep............Account Number..............Invoice Number..........Sales Amount
    ............Mike....................12345...............................TX-EX34.....................80,000


    For example (example 2)
    ............Sales Rep............Account Number..............Invoice Number..........Sales Amount
    Q3.......Jim.......................45774...............................PRS-ET99...................45,000
    Q4.......Jim.......................45774...............................PRS-ET99...................15,000

    After combining data, I would have one single line as follows:
    ............Sales Rep............Account Number..............Invoice Number..........Sales Amount
    ............Jim.......................45774...............................PRS-ET99...................60,000


    I have searched all over the forums, but haven’t found anything that is similar to what I am looking for. I have attached a spreadsheet with sample data, which includes the desired output. Any assistance is appreciated. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combine similar data from multiple sheets

    Hi,

    Do you have access to Excel 2007?
    I ask since the easiest way would be for a macro to first combine all four sheets into one, then extract a unique list of Invoice Numbers (which appears to be the end requirement) and finally summarise by Invoice number along with noting the client name account number and rep number. Excel 2007 would be needed for this approach because of the combined number of rows.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Re: Combine similar data from multiple sheets

    I do have 2007, but only at home. The company I work for only has 2003. Also, other users would need to use code who also only have 2003.

    Also, I looked at your comments. The Invoice Number isn't unique. Sorry I wasn't clear in my initial description. More than one sales rep can be one the same invoice number. See other example below. To combine multiple rows into one row, the "Sales Rep", "Account Number" and "Invoice Number" must all be equal. Thanks.

    ............Sales Rep............Account Number..............Invoice Number..........Sales Amount
    Q1.......Mike....................12345...............................TX-EX34.....................10,000
    Q2.......Mike....................12345...............................TX-EX34.....................20,000
    Q3.......Mike....................12345...............................TX-EX34.....................20,000
    Q3.......Jim......................34625...............................TX-EX34.....................20,000
    Q4.......Mike....................12345...............................TX-EX34.....................50,000
    Q4.......Jim......................34625...............................TX-EX34.....................50,000

    After combining data, I would have one single line as follows:
    ............Sales Rep............Account Number..............Invoice Number..........Sales Amount
    ............Mike....................12345...............................TX-EX34.....................80,000
    ............Jim......................34625...............................TX-EX34.....................70,000

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combine similar data from multiple sheets

    Hi,

    I wasn't suggesting that the invoice numbers would would generate a single unique row, just that the invoice numbers would need to be extracted first and then used along with the rep numbers to generate the relevant rows. However since you don't have 2007 a rethink is needed. I'll take another look.


    Regards

  5. #5
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Re: Combine similar data from multiple sheets

    Ok. Sorry for the confusion. Thanks for the help.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Combine similar data from multiple sheets

    deleted...........
    Last edited by martindwilson; 02-07-2010 at 07:41 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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