+ Reply to Thread
Results 1 to 22 of 22

Need to consolidate and SUM multiple data sets

  1. #1
    Registered User
    Join Date
    02-07-2023
    Location
    West Virginia
    MS-Off Ver
    Office 365
    Posts
    8

    Post Need to consolidate and SUM multiple data sets

    Hey guys, I'm new here and hope someone can help. I am working on a payout sheet with thousands of rows that need to be consolidated. Example attached. The end result needed is as follows:

    Each individual (column B) on this sheet is assigned an owner ID (column A). There is also a Parcel ID (column C) for each unique property, and then an amount owed (a new row for each month) to that individual for that property. These amounts are added to the sheet every month, accumulated for years. I was hoping that there is a way for me to consolidate this data in a way so that there is only one row for every combination of column A and C, and also SUM the amounts for the combined rows. I know there has to be an easier way other than manually copying and consolidating all of this into a new sheet which is what I was asked to do. Please see the example attached, columns G though J is what the end goal needs to be.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Need to consolidate and SUM multiple data sets

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Need to consolidate and SUM multiple data sets

    G2=IFERROR(INDEX(A$2:A$1000,SMALL(IF(FREQUENCY(IF($A$2:$A$1000<>"",MATCH($A$2:$A$1000&$B$2:$B$1000&$C$2:$C$1000,$A$2:$A$17&$B$2:$B$1000&$C$2:$C$1000,0)),ROW($A$2:$A$1000)-ROW($A$2)+1),ROW($A$2:$A$17)-ROW($A$2)+1),ROWS($A$1:A1))),"")

    For office 365 enter for other office control+shift+enter

    copy across and down from g2 to i2


    J2=SUMIFS($D$2:$D$1000,$A$2:$A$1000,$G2,$B$2:$B$1000,$H2,$C$2:$C$1000,$I2)

    Copy down

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Need to consolidate and SUM multiple data sets

    No need to maintain the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-07-2023
    Location
    West Virginia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need to consolidate and SUM multiple data sets

    So, the first formula appears to work. However, when checking the math the figures are not adding up correctly. Not sure where the disconnect is?

    I can't get anything to populate using the other two formulas. Am I missing something?
    Last edited by SgtSaggy; 02-07-2023 at 04:44 PM.

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Need to consolidate and SUM multiple data sets

    with Power Query
    (tailored to your example)

    Please Login or Register  to view this content.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Need to consolidate and SUM multiple data sets

    The formula seems to work in your sample file.
    Attached Files Attached Files

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Need to consolidate and SUM multiple data sets

    And the results are the same as the PQ solution … except that the Owner ID comes out as text in the PQ solution.

  9. #9
    Registered User
    Join Date
    02-07-2023
    Location
    West Virginia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need to consolidate and SUM multiple data sets

    Yes, it even works for small subsets of data within the workbook. However, when I apply the formula to accommodate all 5,670 rows of data the numbers stop adding up. For example, my first 50 lines of data are all the same person. If I apply the formula to only those rows, no issue. I can even apply it to the next 100 or so rows without issue. It is only when applying it to the whole that the numbers break. Thoughts?

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need to consolidate and SUM multiple data sets

    how about post#6 ?

    or show more representative example, you can even attach the entire data as long as the file size does not exceed 1 mb
    Last edited by sandy666; 02-07-2023 at 06:40 PM.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Need to consolidate and SUM multiple data sets

    ALL the solutions return the same values for the sample data.

    I think we'll need to see a sample that demonstrates the problem(s).

  12. #12
    Registered User
    Join Date
    02-07-2023
    Location
    West Virginia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need to consolidate and SUM multiple data sets

    Sorry I disappeared for a while there guys. I got pulled onto another higher priority project and am just now coming back to this.

    Sandy,
    I am currently trying to figure out how to apply your power query to the actual workbook. I have never used it before, so this is a good opportunity to learn, as it does not seem to be as easy as copy/paste. If I cannot get this work, I will try to find a better example to post without disclosing any company info.

    Thank you all for your help and patience.

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need to consolidate and SUM multiple data sets

    do the opposite, copy the data to the file with Power Query and then refresh all
    remember: structure of the original data and example data should be the same
    Last edited by sandy666; 02-08-2023 at 02:58 PM. Reason: typo

  14. #14
    Registered User
    Join Date
    02-07-2023
    Location
    West Virginia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need to consolidate and SUM multiple data sets

    I just figured that out and it works perfectly, Thank you. Now I have a couple of questions if you don't mind. In the original workbook there are more columns, that aren't relevant to what needs to be reported, but would be easier overall if kept in. Can Power Query still perform this task, and copy that other data without factoring it into the consolidation process? Alternatively, does it pull from the entire table or can certain columns be specified? Also, can the table from the Power Query be populated on another sheet within the workbook? Or can it only do so within the same sheet?

  15. #15
    Registered User
    Join Date
    02-07-2023
    Location
    West Virginia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need to consolidate and SUM multiple data sets

    TMS,

    Not discrediting your first formula. It was working great for smaller subsets of data, I just could not figure out why the numbers were getting mixed when applied to the whole sheet. My first thought was that maybe it was due to the existence of both positive and negative dollar amounts, but when separating a small portion of those out and applying the same formula it would still function perfectly. However, I could only get the other formulas provided by you and Caracalla to work on the example sheet. Couldn't figure out why. I will most likely toy around with them all after the fact to satisfy my own curiosity.

  16. #16
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need to consolidate and SUM multiple data sets

    1. It's easier to remove unnecessary columns right in the first step
    2. You can keep them provided you know how to show them as a result (what you want to do with them)
    3. it is not possible to download only selected columns to PQ (eg. A, E, H and so on) columns must form a table, you can only download columns A, B, C without D, E, F but it will still be a table within a table.
    4. you can have the source table in another sheet or workbook
    5. fetch whole table and manage it in PQ editor, don't mix excel and PQ management or formulas and PQ
    6. and one of the most important principles: Power Query is case sensitive and the columns should contain the same type of data
    Last edited by sandy666; 02-08-2023 at 03:32 PM.

  17. #17
    Registered User
    Join Date
    02-07-2023
    Location
    West Virginia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need to consolidate and SUM multiple data sets

    I have successfully accomplished the task at hand. Thank all of you for your input. You are all truly Excel Wizards.

  18. #18
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Need to consolidate and SUM multiple data sets

    Not discrediting your first formula.
    Not at all. If it doesn't work IRL, it doesn't work. I am intrigued as to why not.

    This is the second formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The first part, LET(lr, MATCH(9.9E+307, A:A, 1), determines the last row of data, assuming the data in that column is numeric. If that is not the case, that might be the problem. That, if it is the problem, can be fixed.

  19. #19
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need to consolidate and SUM multiple data sets

    You are welcome and thanks

  20. #20
    Registered User
    Join Date
    11-13-2022
    Location
    Amman - Jordan
    MS-Off Ver
    2016 Use at work 365 at Home
    Posts
    27

    Re: Need to consolidate and SUM multiple data sets

    Is it possible to get the number of package IDs that were added together?
    please in column K

  21. #21
    Registered User
    Join Date
    02-07-2023
    Location
    West Virginia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need to consolidate and SUM multiple data sets

    George,

    If that question is directed at me then I'm sorry, I don't fully understand what you are asking for.

  22. #22
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,877

    Re: Need to consolidate and SUM multiple data sets

    @George Jululian
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Replies: 4
    Last Post: 08-27-2019, 02:40 PM
  2. [SOLVED] Consolidate all data in multiple worksheets of multiple workbooks in one Master file.
    By adil.master in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2014, 09:59 PM
  3. Consolidate two data sets
    By matrix888 in forum Excel General
    Replies: 5
    Last Post: 01-31-2014, 06:24 AM
  4. VBA to fill down for multiple data sets, then consolidate data
    By franklin225 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-07-2012, 02:37 PM
  5. To convert data in multiple sets of columns to multiple rows
    By Dhanya_nair in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2012, 02:49 PM
  6. Line Graph: multiple lines from multiple data sets?
    By Guerodemonio in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-28-2011, 06:15 AM
  7. Multiple charts over multiple sets of data over multiple worksheets.
    By matrocka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2007, 10:01 AM

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