+ Reply to Thread
Results 1 to 8 of 8

Best Way to Sum Values in Variable Positions Across Multiple Sheets?

  1. #1
    Registered User
    Join Date
    07-12-2014
    Location
    USA
    MS-Off Ver
    2003
    Posts
    37

    Best Way to Sum Values in Variable Positions Across Multiple Sheets?

    Basically, I'm trying to tabulate stats that would be manually entered on a grid, where the values would be in a different column for each sheet. Think of it like a box score in baseball, where the lineup is different each game. I want the main team page to automatically calculate a player's total hits, but I can't just do a 3D sum to the same cell on each page, because the individual player won't always be on the same cell (but the row will always be constant). On a discussion I found about a similar problem, one suggestion was to do SUMIF on each sheet, with each player's total for that sheet being in a fixed position, so then you can just do a SUM for that cell across every sheet. It seems like that will work, but I'm just not sure if it's the most expeditious way (also, I'm slightly OCD about having the sheets as "clean" as possible, even with cells that aren't immediately visible). Another suggestion said something about =SUMPRODUCT(SUMIF(INDIRECT... It seemed like that would be a lot more straightforward, but it's a bit too far above my current understanding to figure out exactly how that string of nested formulae works.

    sum_variable_sample.xls

    So, in the attached example, each page after the first has a record of "stuff" and "things" for Bob, John, Steve and Ted, and I'm looking for the best way to have the first page automatically tabulate each person's total of Stuff and Things, even though their placement changes on each page.
    Last edited by tb813; 07-13-2014 at 09:11 PM.

  2. #2
    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,939

    Re: Best Way to Sum Values in Variable Positions Across Multiple Sheets?

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    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

  3. #3
    Registered User
    Join Date
    07-12-2014
    Location
    USA
    MS-Off Ver
    2003
    Posts
    37

    Re: Best Way to Sum Values in Variable Positions Across Multiple Sheets?

    Okay, I edited the first post to add an example.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Best Way to Sum Values in Variable Positions Across Multiple Sheets?

    We would need to know the real sheet names in your real file. I suspect the real sheet names are not Sheet2, Sheet3 and Sheet4.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    07-12-2014
    Location
    USA
    MS-Off Ver
    2003
    Posts
    37

    Re: Best Way to Sum Values in Variable Positions Across Multiple Sheets?

    I'm not sure what they're gonna be called at this point, but if you use Sheet 2, etc. in an example formula, I'm sure I'll able to extrapolate from there and just fill in whatever I ultimately decide to call them.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Best Way to Sum Values in Variable Positions Across Multiple Sheets?

    There are a few ways to handle the sheet names.

    If the sheet names follow a sequential pattern like the default sheet names the we can "build" the sheet names directly into the formula.

    If the sheet names are random then you either have to hardcode them into the formula or list the sheet names in a range of cells.

    Here's an example of listing the sheet names in a range of cells:

    Data Range
    A
    B
    C
    D
    1
    2
    Sheet Names
    Stuff
    Things
    3
    Sheet2
    Bob
    3
    5
    4
    Sheet3
    Steve
    4
    4
    5
    Sheet4
    John
    5
    8
    6
    Ted
    2
    3
    7


    This formula entered in C3:

    =SUMPRODUCT(SUMIF(INDIRECT("'"&A$3:A$5&"'!C2:F2"),B3,INDIRECT("'"&A$3:A$5&"'!C3:F3")))

    This formula entered in D3:

    =SUMPRODUCT(SUMIF(INDIRECT("'"&A$3:A$5&"'!C2:F2"),B3,INDIRECT("'"&A$3:A$5&"'!C4:F4")))

    Select C3:D3 and copy down as needed.

  7. #7
    Registered User
    Join Date
    07-12-2014
    Location
    USA
    MS-Off Ver
    2003
    Posts
    37

    Re: Best Way to Sum Values in Variable Positions Across Multiple Sheets?

    Cool. I believe I understand the principle here. It'll be a while before I can test it in the actual spreadsheet, but it seems like this is exactly what I'm looking for. Thanks!

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Best Way to Sum Values in Variable Positions Across Multiple Sheets?

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Summing variable values across variable sheets in multiple columns
    By rdelosh74 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2014, 02:16 PM
  2. [SOLVED] Compile data from multiple sheets with different header positions
    By lekiwonder in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-07-2012, 11:54 AM
  3. [SOLVED] Numerical values (in variable positions) associated to text cells
    By eloureiro in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-02-2012, 07:02 PM
  4. [SOLVED] reference a cell a variable number of positions away
    By kamelkid2 in forum Excel General
    Replies: 2
    Last Post: 05-22-2012, 01:07 PM
  5. [SOLVED] Changing the positions of certain sheets in excel
    By Aamir in forum Excel General
    Replies: 3
    Last Post: 07-15-2005, 02:05 PM

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