+ Reply to Thread
Results 1 to 12 of 12

Average over more sheets with criteria

  1. #1
    Registered User
    Join Date
    11-12-2007
    Location
    Dordrecht, Netherlands
    MS-Off Ver
    2016
    Posts
    35

    Average over more sheets with criteria

    Hi all,

    I have probably a very simple question, but cant seem to get the formula right What I would like is the average of numbers that are on certain sheets with a certain criteria. I have an excel example that might explain more.

    Hope anyone can help me with this.

    Regards

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Average over more sheets with criterium

    Please post your sample.

    Conditional Calculations in 3D are, generally speaking, both complex and inefficient.

  3. #3
    Registered User
    Join Date
    11-12-2007
    Location
    Dordrecht, Netherlands
    MS-Off Ver
    2016
    Posts
    35

    Re: Average over more sheets with criterium

    Didn't I post an example? sorry!!!
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Average over more sheets with criterium

    Based purely on your sample file:

    Please Login or Register  to view this content.
    The inline array can be changed to a range containing the sheet names you wish to sum... note though the range used must always contain valid sheet names else you will get a #REF! error.

    The above is a Volatile SUMPRODUCT and as such should

    a) be used with "lean" ranges (ie avoid referencing unneeded rows)

    b) be used in moderation

  5. #5
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Average over more sheets with criterium

    I found the following:

    Please Login or Register  to view this content.
    Where Z1:Z5 have the sheet names.

    edit: DonkeyOte gave the exact same solution. Picked it up from: http://www.mcgimpsey.com/excel/threedsumif.html
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  6. #6
    Registered User
    Join Date
    11-12-2007
    Location
    Dordrecht, Netherlands
    MS-Off Ver
    2016
    Posts
    35

    Thumbs up Re: Average over more sheets with criterium

    Thanks, that might help! I already have all the names of the sheets named as a range, so that will be easy. As for the warning; The sheet was already very slow, so I turned of automatic update and let users update at the end (by saving or pressing F9).

    It's not a sheets that will be used that often so no problem.

    Thanks again!

  7. #7
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Average over more sheets with criterium

    so I turned of automatic update and let users update at the end (by saving or pressing F9).
    this is an option if you control the sheet yourself. When controlled by others this will lead to errors.

    In your case you require these kind of VERY DIFFICULT and nested formula's as your data is scattered. Maybe go back to the drawing table and find a way to structure the data. Then these kind of formula's are no longer required.

    See the signature of DonkeyOte and look at the Volatile link. This might shine some light on 'why is my WB so slow'

  8. #8
    Registered User
    Join Date
    11-12-2007
    Location
    Dordrecht, Netherlands
    MS-Off Ver
    2016
    Posts
    35

    Lightbulb Re: Average over more sheets with criterium

    Another question on this by the way:

    Can this be done for MIN and MAX value as well somehow?

  9. #9
    Registered User
    Join Date
    11-12-2007
    Location
    Dordrecht, Netherlands
    MS-Off Ver
    2016
    Posts
    35

    Re: Average over more sheets with criterium

    Quote Originally Posted by rwgrietveld View Post
    this is an option if you control the sheet yourself. When controlled by others this will lead to errors.

    In your case you require these kind of VERY DIFFICULT and nested formula's as your data is scattered. Maybe go back to the drawing table and find a way to structure the data. Then these kind of formula's are no longer required.

    See the signature of DonkeyOte and look at the Volatile link. This might shine some light on 'why is my WB so slow'
    Might be true, but since I have an overall sheet that gathers information from 25 other sheets each with at least 60 references, it's slow already....tried the drawing board over and over again, but dont see any other way (yet)....I think I'll hardcode the manual in VB and let people refresh by button placed in a sheet...

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Average over more sheets with criteria

    Slow files are invariably caused by over use of Arrays (incl. Sumproduct) and Volatile functions ... worse still combinations of the two (like the above)... a file with lots of Volatiles that relies heavily on Volatile action functionality like Filtering etc will grind things to a halt quite nicely...
    (you can chuck conditional formatting in the mix for good measure)

  11. #11
    Registered User
    Join Date
    11-12-2007
    Location
    Dordrecht, Netherlands
    MS-Off Ver
    2016
    Posts
    35

    Re: Average over more sheets with criteria

    Quote Originally Posted by DonkeyOte View Post
    (you can chuck conditional formatting in the mix for good measure)
    Already did that, don't worry And it is slow because he recalculates the cells the whole time (which takes about 15 seconds). Shutting that down makes it pretty quick actually

    I'll try to think of a different solution, but not sure that will work for what I need.

    @DonkeyOte Do you know how to get the Minimal and maximum of all these values as well? (so from all Q2 values, the lowest and highest)

  12. #12
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Average over more sheets with criteria

    Please try to keep threads to one question where at all possible.

    If you want to conduct conditional MIN/MAX in 3D then realistically you're looking at

    a) UDF (VBA)

    b) installing Laurent Longre's morefunc.xll and utilising the THREED function

    General rule of thumb in these scenarios is to calculate each sheet individually in a table of sorts and then work from the resulting table to calculate the "3D-result"

    If you've listed your sheets for use in the 3D SUMIF then you already have that list... the rest should be pretty trivial
    ie use standard MIN/MAX/AVG arrays in conjunction with INDIRECT using the sheet name as differentiating item -- given you say performance of your file is already horrendous the above will make little difference.
    Last edited by DonkeyOte; 11-06-2009 at 04:30 AM. Reason: missing key word -- conditional

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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