+ Reply to Thread
Results 1 to 11 of 11

Formula to sum cells across multiple sheets or future sheets

  1. #1
    Registered User
    Join Date
    03-25-2015
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2013
    Posts
    43

    Formula to sum cells across multiple sheets or future sheets

    Hello everyone,

    I have a little problem with counting up cells on multiple and future sheets (future sheets = sheets that have not been created yet but i know the name of), so let`s get this started

    The data i would like to COUNT up from each sheet are on the L row but i need to find if the data on the L row is "SAMPLE"

    i know that is something with sumproduct COUNTIF and indirect but i keep getting errors since the indirect points me towards sheets that do not exist.

    Is there a formula i can use or is this only vba?

    Thanks,
    -Alex
    Last edited by dLhx; 03-13-2017 at 01:26 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Formula to sum cells across multiple sheets or future sheets

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    03-25-2015
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2013
    Posts
    43

    Re: Formula to sum cells across multiple sheets or future sheets

    Here is the document.

    On the DATA sheet in cell F8 i would like to have the counts of the "Test1" text from Cell F7 across the 13-Mar L:L and 14-Mar L:L columns but if i add 15-Mar (sheet) to take that also into account.

    Thanks,
    -Alex
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Formula to sum cells across multiple sheets or future sheets

    Agree with Glenn regarding the sample file, but see if this will get you started.

    1. Create a list of all sheet names
    2. Give that list a range name
    (you could name the named range dynamic to allow for added sheets)
    3. put this where you want the answer to be (adjust ranges as needed)...
    =SUMPRODUCT(SUMIF(INDIRECT("'"&Tabs&"'!A6:A1000"),A2,INDIRECT("'"&Tabs&"'!B6:B1000")))

    This assumes that your criteris in in column A on the data sheets and the values in column B
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Formula to sum cells across multiple sheets or future sheets

    One way, using a named Range (sheetlist), formula:
    =DATA!N$1:INDEX(DATA!$N$1:$N$1000,COUNTA(DATA!$N$1:$N$1000))

    and this formula:

    =SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheetlist&"'! L3:L11"),$F$7))

    just add on additonal sheets as needed (or you can get excel to list All of the relevant sheets for you).

    If you want to do that, too. Just ask.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 03-13-2017 at 02:01 PM.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Formula to sum cells across multiple sheets or future sheets

    LOL title said SUM, so I (incorrectly) used SUMIF, but description said COUNT, so Glenn (correctly) used COUNTIF

  7. #7
    Registered User
    Join Date
    03-25-2015
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2013
    Posts
    43

    Re: Formula to sum cells across multiple sheets or future sheets

    Yeah, sorry about that FDibbins,

    @Glenn: I don`t understand:

    =DATA!N$1:INDEX(DATA!$N$1:$N$1000,COUNTA(DATA!$N$1:$N$1000)) - this should do what?


    Also the sumproduct returns REF

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Formula to sum cells across multiple sheets or future sheets

    As an alternative to the volatile INDIRECT() function, I prefer to:

    1) Put a helper cell on each tab that computes the conditional count/sum for that tab. =COUNTIF(L3:L11,DATA!F7)
    2) Put a sum function with a 3D reference to add up all of the counts: =SUM('13-Mar:14-Mar'!A1).
    3) To simplify adding/removing tabs, I often add a couple of blank, "dummy" tabs before and/or after the desired sum range, and set the 3D reference to include those dummy sheets. Any sheets in between the dummy tabs are included in the 3D sum and any sheets outside of the dummy sheets are not included. =SUM(start:end!A1)

    This has a overview of 3D references: https://support.office.com/en-us/art...es_in_formulas
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Formula to sum cells across multiple sheets or future sheets

    It is a named range. On the sheet that I posted, on sheet data, hit CTRL-F3. It calls up the list of named ranges. There is one "Sheetlist". That's where that formula is. It automatically feeds the list of sheets present in column N into the sumproduct formula.

    Do you accept that the formulae works on the POSTED sheet of mine. Try adding another sheet. Does it still work?

  10. #10
    Registered User
    Join Date
    03-25-2015
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2013
    Posts
    43

    Re: Formula to sum cells across multiple sheets or future sheets

    It works like a charm, thank you so very much

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Formula to sum cells across multiple sheets or future sheets

    It IS a charm. Thanks for the Rep.

+ 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. Formula to move multiple cells or information across different sheets?
    By kfleck1109 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2016, 01:30 AM
  2. Adding all cells across multiple sheets with certain formula.
    By enanthate in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-13-2016, 02:52 PM
  3. Formula to match multiple cells in 2 sheets
    By mubeenff in forum Excel General
    Replies: 15
    Last Post: 02-01-2015, 04:43 AM
  4. Replies: 1
    Last Post: 02-12-2014, 01:49 AM
  5. Replies: 4
    Last Post: 01-15-2014, 10:26 AM
  6. Replies: 0
    Last Post: 05-09-2013, 10:19 AM
  7. How do I protect formula cells on multiple sheets?
    By Webdiva in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-03-2005, 04:06 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