+ Reply to Thread
Results 1 to 4 of 4

Building a summary table across multiple worksheets (SUMIF or VBA?)

  1. #1
    Registered User
    Join Date
    05-23-2011
    Location
    Ballston Spa, NY
    MS-Off Ver
    Excel for Office 365
    Posts
    18

    Building a summary table across multiple worksheets (SUMIF or VBA?)

    Hello,

    The attached spreadsheet builds upon an item that was solved here: http://www.excelforum.com/excel-gene...ell-above.html

    In my workbook, the worksheet called SUMMARY needs to collect, from numerous worksheets, the totals that are found in Rows 3-15 on every relevant worksheet. Those rows have the same Share identifiers (S1.1, S2.4, etc.). The column entries in those Rows 3-15 vary in their start position (first column containing good data) and in the number of columns containing data. Each column has a heading in the format ITEM A, ITEM B, etc. (fake item names). In some cases the same ITEM will repeat in multiple columns (though not in the example attached) and each instance needs to be captured.

    On the SUMMARY worksheet, the ITEMS A-N are listed in rows and I need to return in separate columns the breakdown based on the Share identifier.

    For example: SUMMARY worksheet, Row 13 is for ITEM E; its cumulative quantity is 1881 (cell K13). I need to return at cell P13 (under S1.1) the total, across all relevant worksheets, for quantities in Row 7 where the column heading (Row 3) equals ITEM E. So it would be WSHEET1 cell L5 plus WSHEET2 (row 5, no column matches) plus WSHEET3 (row 5, no column matches), etc. In other words it would add up every Row 5 entry on every worksheet where the column heading is ITEM E. The formula would be entered in SUMMARY cell P9 and copied down P9 to P22. --> Then similar formulas would be constructed for all the yellow-highlighted fields in the SUMMARY worksheet.

    Above I say that all "relevant worksheets" are to be added. What I mean by that is in my real workbook there are about 30 worksheets to be summed (identified by same tab color) and 10-15 other worksheets (not-relevant) that do not contain info to be summed. However, I don't believe the not-relevant worksheets would foul up a formula that were applied to ALL worksheets (since they don't have text that would match a SUMIF). That said, ideally the formula would only target the relevant, color-coded worksheets.

    It seems like a SUMIF across the multiple relevant worksheets is what I need but not sure how to construct. But any solution would be great - whether a formula solution or a VBA solution (such as a button-macro) to step through a group of worksheets and collect/paste the info into SUMMARY? This is the last step in my workbook!

    Thank you very much for any thoughts,

    Steve
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-23-2011
    Location
    Ballston Spa, NY
    MS-Off Ver
    Excel for Office 365
    Posts
    18

    Re: Building a summary table across multiple worksheets (SUMIF or VBA?)

    I looked further into my own question/request. The below formula, pasted into all the yellow highlighted cells on the SUMMARY will do the math I need for one sheet.

    =SUMIF('WSHEET 1'!$C$3:$AZ$3,CONCATENATE("ITEM ",$H9),INDEX('WSHEET 1'!$C:$AZ,MATCH(O$8,'WSHEET 1'!$B:$B,0),0))

    See updated spreadsheet with the above formula included. This successfully totals WSHEET 1 but of course no other sheets.

    My question then boils down to: how do I apply this formula to a selection of multiple worksheets, and have it be flexible so that more sheets can be added or sheets removed?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-23-2011
    Location
    Ballston Spa, NY
    MS-Off Ver
    Excel for Office 365
    Posts
    18

    Re: Building a summary table across multiple worksheets (SUMIF or VBA?)

    Maybe if I build a sheet list and use SUMPRODUCT and INDIRECT (speculating based on https://exceljet.net/formula/3d-sumi...ple-worksheets)? I'll start down that path but would love to hear any better/simpler ideas

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,551

    Re: Building a summary table across multiple worksheets (SUMIF or VBA?)

    This proposed solution adds a helper table to each of "WSHEET"'s, mirroring the setup of the table on the summary sheet and populated using the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The table on the summary sheet is populated using the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The WSHEET tables may be copied from one sheet to another providing that they all have the same format (not including the Item names). Put the sheets to be summed between the Start and End sheets as shown in the attached copy of your file.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. [SOLVED] Populate summary table with values from various worksheets
    By Lyndo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-02-2015, 09:39 AM
  2. Consolidating data from multiple worksheets into a summary sheet having multiple criteria
    By Marushka Pinto in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-16-2015, 11:11 PM
  3. Replies: 1
    Last Post: 06-03-2015, 06:27 PM
  4. [SOLVED] Summary Table generated from Data Worksheets
    By kristy.brown in forum Excel General
    Replies: 8
    Last Post: 07-02-2014, 05:13 PM
  5. Copying multiple cells from multiple worksheets to one summary sheet
    By Dragothemensch in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2013, 08:39 PM
  6. Replies: 3
    Last Post: 01-05-2013, 02:20 AM
  7. creating summary table from selected rows of multiple worksheets
    By jrtaylor in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2009, 11:54 AM

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