+ Reply to Thread
Results 1 to 5 of 5

Average cells based on data in adjacent cells.....Again

  1. #1
    Registered User
    Join Date
    06-25-2013
    Location
    Idaho, USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Average cells based on data in adjacent cells.....Again

    First, thanks to XOR LX for pointing me in the right direction on my last post.
    I'm trying to average a column of cells "L" based on data in several other cells while excluding zeros and blank cells. XOR LX gave me the formula that will do the average, but it's not omitting zeros and blank cells. I've tried tweaking it myself, but I'm getting an #DIV/0! error, so I assume I don't have something right.

    =AVERAGE(IF((Detail!$W$2:$W$4019>TIME(9,59,0))*($W$2:$W$4019<TIME(14,0,))*($Z$2:$Z$4019="Monday")*($Q$2:$Q$4019="Y"),$L$2:$L$4019)) Averages with zeros and blanks.

    =AVERAGE(IF((Detail!$W$2:$W$4019>TIME(5,59,0))*($W$2:$W$4019<TIME(10,0,))*($Z$2:$Z$4019="Monday")*($Q$2:$Q$4019="Y")*($L$2:$L$4019>="0"),$L$2:$L$4019)) Gives me the error.

    Thanks again in advance.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Average cells based on data in adjacent cells.....Again

    Perhaps

    =AVERAGEIFS($L$2:$L$4019,$L$2:$L$4019,"<>0",$W$2:$W$4019,">"&TIME(9,59,0),$W$2:$W$4019,"<"&TIME(14,0,),$Z$2:$Z$4019,"Monday",$Q$2:$Q$4019,"Y")

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Average cells based on data in adjacent cells.....Again

    you have excel 2007 have you tried averageifs?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Average cells based on data in adjacent cells.....Again

    or change "0" in your formula to just 0

    The quotes makes it a TEXT String, not the number 0.

  5. #5
    Registered User
    Join Date
    06-25-2013
    Location
    Idaho, USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Average cells based on data in adjacent cells.....Again

    =AVERAGE(IF((Detail!$W$2:$W$4019>TIME(5,59,0))*($W$2:$W$4019<TIME(10,0,))*($Z$2:$Z$4019="Monday")*($Q$2:$Q$4019="Y")*($L$2:$L$4019>0),$L$2:$L$4019)) Works. Thanks for all the help.

+ 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