+ Reply to Thread
Results 1 to 12 of 12

Sumif across several worksheets

  1. #1
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Sumif across several worksheets

    This is the beginning of a monster of a formula (to me at least) which searches 30 worksheets for the occurrence of a code before adding up the total value for each code. Is there a more elegant way of doing this that picks up all the worksheets without having to name each one within the formula?

    =SUMIF('2 Pers SbS AE Screen'!C:AE,Products!A3,'2 Pers SbS AE Screen'!AE:AE)+SUMIF('3 Pers SbS AE Screen'!C:AE,Products!A3,'3 Pers SbS AE Screen'!AE:AE)+SUMIF('4 Pers SbS AE screen'!C:AE,Products!A3,'4 Pers SbS AE screen'!AE:AE)++SUMIF('4 Pers AE Screen'!C:AE,Products!A3,'4 Pers AE Screen'!AE:AE)+SUMIF('6 Person AE Screen'!C:AE,Products!A3,'6 Person AE Screen'!AE:AE)

    Any help gratefully received.

    T.

  2. #2
    Registered User
    Join Date
    09-02-2015
    Location
    California
    MS-Off Ver
    2013
    Posts
    23

    Talking Re: Sumif across several worksheets

    You could try naming the ranges within each sheet e.g.:
    =SUMIF(RANGE2,"=a",RANGE3)
    As long as you keep the names unique you will be able to sum across your sheets without issue.

    Let me know if you need help with named ranges.

    The Excel Fixer

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Sumif across several worksheets

    hi twaccess. i supposed the item in Products!A3 can be found in just column C of the other sheet? if so, you don't have to range C:AE. you can use 2 methods. one is to do a SUMIF in each individual sheet & then summing them up in the consolidated sheet. the other is to use 3D SUMIF. you do this by typing the worksheet name say in D1:D5 of the consolidated sheet. then:
    =SUMPRODUCT(SUMIF(INDIRECT("'"&D1:D2&"'!C:C"),Products!A3,INDIRECT("'"&D1:D2&"'!AE:AE")))

    you can get an idea here too:
    http://www.mrexcel.com/forum/excel-q...-indirect.html

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Sumif across several worksheets

    Sorry guys, I must be really thick because I'm just not getting it. I spent an hour last reading the above and the links. Then a few more minutes this morning. Unfortunately, I'm no further forward.. thank you anyway. I'm probably going to have to do this the long way round.
    Terry

    "... I thought I was a power user of Excel until I came onto these boards..."

  5. #5
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Sumif across several worksheets

    Gawd... its funny how you say you can't do something... then a few moments later, it happens... you get it... I think. I made the formula work at least in the example. Thanks again.

  6. #6
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Sumif across several worksheets

    Gawd... its funny how you say you can't do something... then a few moments later, it happens... you get it... I think. I made the formula work at least in the example. Thanks again.

  7. #7
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Sumif across several worksheets

    This formula has only gone and worked across 70 worksheet pages !!

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Worksheets&"'!c:c"),A4,INDIRECT("'"&Worksheets&"'!b:b")))

    I also learned how to create a list of Worksheet names which I then put into a range name called 'Worksheets'

    I think I've found a new love... Indirect...

  8. #8
    Registered User
    Join Date
    09-02-2015
    Location
    California
    MS-Off Ver
    2013
    Posts
    23

    Re: Sumif across several worksheets

    Can you mark the post as solved please? Its in the thread tools.

  9. #9
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Sumif across several worksheets

    Quote Originally Posted by ExcelFixer View Post
    Can you mark the post as solved please? Its in the thread tools.
    Sorry about that. I was accessing via my iPhone for a few days which the tools didn't appear for some reason. All done and thanks again.

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

    Re: Sumif across several worksheets

    Quote Originally Posted by twaccess View Post
    I also learned how to create a list of Worksheet names which I then put into a range name called 'Worksheets'
    Like this...

    List worksheet names using a formula
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  11. #11
    Forum Contributor
    Join Date
    11-02-2003
    Location
    Birmingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Sumif across several worksheets

    Quote Originally Posted by Tony Valko View Post
    Thank you Tony, I lost my original copy of this post. Bookmarked now

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

    Re: Sumif across several worksheets

    Good deal. Thanks for the feedback!

+ 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. SUMIF Across Worksheets
    By omniplanet in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-21-2013, 12:26 PM
  2. SUMIF across worksheets
    By cjt_choccy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-15-2012, 01:37 PM
  3. SUMIF across worksheets
    By TranceDiablo in forum Excel General
    Replies: 5
    Last Post: 02-09-2010, 08:34 PM
  4. Sumif from 2 worksheets
    By guyzk1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-20-2008, 10:38 PM
  5. SUMIF across all worksheets
    By BarryTheHatchet in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-20-2007, 11:14 PM
  6. [SOLVED] SUMIF across worksheets
    By Patricia in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-24-2006, 02:10 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