+ Reply to Thread
Results 1 to 10 of 10

Sum on Multiple Sheets based on Single Condition

  1. #1
    Registered User
    Join Date
    06-09-2017
    Location
    Lansing, MI
    MS-Off Ver
    2013
    Posts
    12

    Sum on Multiple Sheets based on Single Condition

    I have a spreadsheet that I need to sum numbers in separate columns on different sheets, based on a common number that is shared between each sheet.

    There are several columns of numbers, each column representing a bar size. I used random numbers to represent weights.

    For example, I need the sum of all the "3" bar weights from each sheet, and displayed in cell B2 on the Summary page, and so on.

    You will better understand if you look at the attached spreadsheet.

    We are using Excel 2013.

    Thanks,
    Chris
    Attached Files Attached Files
    Last edited by ceranes; 02-15-2019 at 11:06 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Sum on Multiple Sheets based on Single Condition

    Please manually enter the results you are expecting on the summary sheet and explain in words your calculations for cells B2 and C2.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-09-2017
    Location
    Lansing, MI
    MS-Off Ver
    2013
    Posts
    12

    Re: Sum on Multiple Sheets based on Single Condition

    On the summary page, within cell B2, I need to display the totals from Sheet1(Cell B3) and Sheet2(Cell B3). Cell C2 on the Summary page is just the weight from B2 / 2,000. (140,135 lbs. / 2,000 = 70.06 Tons).

    69,790 + 70,345 = 140,135.

    I'm not sure if your numbers will be different because I am the RANDBETWEEN function.

    Hope this makes sense.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Sum on Multiple Sheets based on Single Condition

    Please try at B2 and drag down

    =SUM(INDEX(CHOOSE({1;2},Sheet1!$B$3:$L$3,Sheet2!$B$3:$L$3),,MATCH(A2,Sheet1!$B$2:$L$2,)))

  5. #5
    Registered User
    Join Date
    06-09-2017
    Location
    Lansing, MI
    MS-Off Ver
    2013
    Posts
    12

    Re: Sum on Multiple Sheets based on Single Condition

    I will give it a try.

    I attached another version showing how the formulas should be setup. The only difference is that I could have 50 or more sheets, and not just two as I have in this example.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-09-2017
    Location
    Lansing, MI
    MS-Off Ver
    2013
    Posts
    12

    Re: Sum on Multiple Sheets based on Single Condition

    That worked Bo_Ry, but I wonder how we could make it so no matter how many sheets we have, it will always create the same summary?

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Sum on Multiple Sheets based on Single Condition

    Please try at B2
    =SUMPRODUCT(SUMIFS(INDIRECT("sheet"&ROW($A$1:$A$2)&"!B3:L3"),INDIRECT("sheet"&ROW($A$1:$A$2)&"!B2:L2"),A2))

    Blue is your sheet name, if you have 50 sheets, change Red "2" to 50

  8. #8
    Registered User
    Join Date
    06-09-2017
    Location
    Lansing, MI
    MS-Off Ver
    2013
    Posts
    12

    Re: Sum on Multiple Sheets based on Single Condition

    That works as well!

    Is it possible for Excel to just know how many sheets there are without having to modify the formulas myself?

    My goal is to be able to pass this along to a co-worker, who can just start using it without having to modify anything.

    If that is too much to ask, I will consider this a success and say thank you very much for your assistance!

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Sum on Multiple Sheets based on Single Condition

    Please try

    =SUMPRODUCT(SUMIFS(INDIRECT("sheet"&ROW(INDIRECT("1:"&SHEETS()-1))&"!B3:L3"),INDIRECT("sheet"&ROW(INDIRECT("1:"&SHEETS()-1))&"!B2:L2"),A2))

    SHEETS() give all sheet count and -1 for the summary sheet.

  10. #10
    Registered User
    Join Date
    06-09-2017
    Location
    Lansing, MI
    MS-Off Ver
    2013
    Posts
    12

    Re: Sum on Multiple Sheets based on Single Condition

    You are awesome Bo_Ry! Thank you very much!

+ 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] Search specific text from multiple sheets based on condition
    By sreeks in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-23-2017, 08:37 PM
  2. Replies: 0
    Last Post: 08-21-2017, 12:26 AM
  3. Copy rows from multiple sheets based on condition
    By murzilka in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2016, 04:49 PM
  4. [SOLVED] Lookup and sum multiple values based on a single criteria in multiple sheets.
    By paulsanett in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2014, 12:18 PM
  5. Replies: 1
    Last Post: 08-06-2012, 12:14 PM
  6. Replies: 4
    Last Post: 08-16-2011, 09:32 PM
  7. sum multiple sheets based on condition
    By Mile029 in forum Excel General
    Replies: 2
    Last Post: 05-25-2011, 04:59 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