+ Reply to Thread
Results 1 to 12 of 12

average on multiple sheets excluding zero

  1. #1
    Registered User
    Join Date
    08-27-2014
    Location
    Manila
    MS-Off Ver
    2007
    Posts
    9

    average on multiple sheets excluding zero

    Hi,

    I am unable to average multiple cells on different sheets and exclude zero. i understand that averageif does not recognize different sheets. however my sum formula does not seem to work.

    In Sheet1, cell W3, i need to type in a formula that would average items on sheet2!E5:E7 and sheet3!E5:E7 and exclude zeros on the calculations "<>0"

    i tried =SUM('Sheet2'!E5:E7, 'Sheet3'!E5:E7)/INDEX(FREQUENCY('Sheet2'!E5:E7, 'Sheet3'!E5:E7),2) but its not accepting it.

    thanks in advance!

  2. #2
    Registered User
    Join Date
    06-27-2013
    Location
    Boulder, CO
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: average on multiple sheets excluding zero

    You might try SUM / COUNTIF

    Hope that helps.

    -Z

  3. #3
    Registered User
    Join Date
    08-27-2014
    Location
    Manila
    MS-Off Ver
    2007
    Posts
    9

    Re: average on multiple sheets excluding zero

    Thanks but how will my formula be?

    tia!

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: average on multiple sheets excluding zero

    Syntax like this:

    Please Login or Register  to view this content.
    Maybe you could do it with 2x AVERAGEIF /2, but then you'd have to have at least one value in both ranges, so Zoodeek's solution is more robust that that.

  5. #5
    Registered User
    Join Date
    06-27-2013
    Location
    Boulder, CO
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: average on multiple sheets excluding zero

    =sum(Sheet2!E5:E7,Sheet3!E5:E7)/(COUNTIF(Sheet2!E5:E7,"<>0")+COUNTIF(Sheet3!E5:E7,"<>0"))

    This should get you where you want to go.

    -Z

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: average on multiple sheets excluding zero

    Quote Originally Posted by jayp_ View Post
    =SUM('Sheet2'!E5:E7, 'Sheet3'!E5:E7)/INDEX(FREQUENCY('Sheet2'!E5:E7, 'Sheet3'!E5:E7),2)
    You need to tweak that syntax a little for the correct 3d references, and the INDEX function needs a 2nd argument of zero....like this

    =SUM(Sheet2:Sheet3!E5:E7)/INDEX(FREQUENCY(Sheet2:Sheet3!E5:E7,0),2)

    That formula is easily "extensible" to any number of worksheets
    Audere est facere

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: average on multiple sheets excluding zero

    Quote Originally Posted by daddylonglegs View Post
    You need to tweak that syntax a little for the correct 3d references, and the INDEX function needs a 2nd argument of zero....like this

    =SUM(Sheet2:Sheet3!E5:E7)/INDEX(FREQUENCY(Sheet2:Sheet3!E5:E7,0),2)

    That formula is easily "extensible" to any number of worksheets
    Perhaps it's worth adding the caveat that this depends on their being no negative numbers within those ranges.

    Presume that the OP knows this in any case since they're using this set-up.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: average on multiple sheets excluding zero

    Quote Originally Posted by XOR LX View Post
    Perhaps it's worth adding the caveat that this depends on their being no negative numbers within those ranges.
    Absolutely, yes. Thanks XOR LX

    My feeling is that if negative numbers are valid then you'd expect zero to be a valid value too - it's only where all values are positive that zeroes can be regarded as "no info" type values.

    Having said that, if you do want the average to possibly include negative values you can define a sheetlist and use a SUMIF/COUNTIF construction to get the required result, e.g.

    =SUMIF(INDIRECT("'"&sheetlist&"!E5:E7"),"<>0")/COUNTIF(INDIRECT("'"&sheetlist&"!E5:E7"),"<>0")

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: average on multiple sheets excluding zero

    Maybe this will work for you:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: average on multiple sheets excluding zero

    You can still use the FREQUENCY set-up for negative numbers as well.

    If the values in question are all integers:

    =SUM(Sheet2:Sheet3!E5:E7)/SUM(INDEX(FREQUENCY(Sheet2:Sheet3!E5:E7,{-1,0}),N(IF(1,{1,3}))))

    If not:

    =SUM(Sheet2:Sheet3!E5:E7)/SUM(INDEX(FREQUENCY(Sheet2:Sheet3!E5:E7,0-{0.0000001,0}),N(IF(1,{1,3}))))

    or some such suitably small value in place of 0.0000001.

    Regards

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: average on multiple sheets excluding zero

    Ha! I thought you might go that route.

    I'm always a little dissatisfied with any solution that needs to use a VSV (very small value) like 0.000001, but it does the job

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: average on multiple sheets excluding zero

    Quote Originally Posted by daddylonglegs View Post
    Ha! I thought you might go that route.

    I'm always a little dissatisfied with any solution that needs to use a VSV (very small value) like 0.000001, but it does the job
    Completely agree with the VSV bit - I cringed a bit myself when posting that!

+ 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. Replies: 4
    Last Post: 06-11-2014, 07:56 AM
  2. Appending multiple sheets into one excluding header cells
    By knevil in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2014, 11:37 AM
  3. Multiple Sheets Multiple Criteria Average Data
    By apauaie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-17-2013, 01:13 PM
  4. The rank of average ranks excluding empty cells but including their average.
    By Terminal45 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2012, 03:44 AM
  5. Copy specific cell from multiple sheets to summary - excluding some sheets
    By kabammi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-01-2012, 09:27 AM

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