+ Reply to Thread
Results 1 to 12 of 12

AverageIF across sheet range not working

Hybrid View

  1. #1
    Registered User
    Join Date
    03-09-2012
    Location
    ft worth, tx
    MS-Off Ver
    Excel 2003
    Posts
    27

    AverageIF across sheet range not working

    Using Excel 2003

    I need a formlula that averages a cell from 31 sheets, but only averages a zero in IF cell A7 from all 31 sheets does NOT contain the letter X.

    I have a monthly (sheet 32) that is pulling numbers from sheets 1-31 for a total picture of the month. One of these cells is an average of cell V3 for all 31 sheets. On some of the 31 sheets I am using an X in A7 to discount anything on that sheet (X signifies a day off). How would I write this formula. We DO want to include the 0 in the average if it was a working day, ie A7 does not contain an X.

    I have tried a number of formulas but to no avail. Thanks for the assistance on this.
    Last edited by cmac7872; 03-09-2012 at 12:56 PM. Reason: Moderator request

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Need formula help

    Hi,

    Please take a moment to read the forum rules and adjust your thread title accordingly.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    03-09-2012
    Location
    ft worth, tx
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: AverageIF across sheet range not working

    Thanks Dom. Sorry for thread title. Hopefully the corrected title is sufficient. Thanks.

    Chris

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: AverageIF across sheet range not working

    Thanks.

    If you list your sheet names in A2:A32 you can then use:

    =AVERAGE(IF(N(INDIRECT("'"&A2:A32&"'!A7"))<>"X",N(INDIRECT("'"&A2:A32&"'!V3"))))

    Dom

  5. #5
    Registered User
    Join Date
    03-09-2012
    Location
    ft worth, tx
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: AverageIF across sheet range not working

    Thanks. I tried this:


    =AVERAGE(IF(N(INDIRECT("'"&sheet1:sheet31&"'!A7"))<>"X",N(INDIRECT("'"&sheet1:sheet31&"'!V3"))))

    but got a #NAME? error.

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: AverageIF across sheet range not working

    You have to actually list the sheet names in A2:A32 (or somewhere else you'd prefer). The formula won't accept a 3D reference like that.

    Dom

  7. #7
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: AverageIF across sheet range not working

    DaddyLonglegs has pointed out that the formula should probably use T rather than the first N with the criteria being text although they both seem to work.

    =AVERAGE(IF(T(INDIRECT("'"&A2:A32&"'!A7"))<>"X",N(INDIRECT("'"&A2:A32&"'!V3"))))

    @daddylonglegs - I tried to reply to your PM but your inbox is full.

    Dom

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: AverageIF across sheet range not working

    Nope he's right. Should definitely be T. I also failed to point out that this is an array formula and should be confirmed with Ctrl+Shift+Enter.

    Dom

  9. #9
    Registered User
    Join Date
    03-09-2012
    Location
    ft worth, tx
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: AverageIF across sheet range not working

    I put sheet1 through sheet31 in the L column (L2:L32) and tried this:

    =AVERAGE(IF(N(INDIRECT("'"&L2:L32&"'!A7"))<>"X",N(INDIRECT("'"&L2:L32&"'!V3"))))
    I am getting an actual value now, but it is not the correct number. I need an average daily violation number from days worked. The number of violations total in V3 on sheet1:31 so then on the monthly report I need it to calculate the total violations divided by the number of days worked. When the employee is off they indicate that by placing an "x" in A7 on sheet1:sheet31.

    We marked sheet1:sheet29 as days off and put 10 violations on sheet30 and 8 violations on sheet31 so the value we would be looking for is 9 but it is returning a value of 0.

    Thanks for helping us work through this.

  10. #10
    Registered User
    Join Date
    03-09-2012
    Location
    ft worth, tx
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: AverageIF across sheet range not working

    Wow. That absolutely worked! Thanks so much for all the help Dom and daddylonglegs.

  11. #11
    Registered User
    Join Date
    03-09-2012
    Location
    ft worth, tx
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: AverageIF across sheet range not working

    Did not see last replies..let me try them real quick.

  12. #12
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: AverageIF across sheet range not working

    No worries. Please mark the thread solved if you're happy with the solution.

    Dom

+ 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