+ Reply to Thread
Results 1 to 12 of 12

AVERAGEIFS with date range condition

  1. #1
    Registered User
    Join Date
    02-09-2015
    Location
    muc
    MS-Off Ver
    Ms 2013
    Posts
    5

    Question AVERAGEIFS with date range condition

    Hi all,

    Would appreciate help with making this formula work:

    =AVERAGEIFS([AVG range];[criteria 1 range - numbers];[criteria 1: all empty cells];[criteria 2 range - dates]; [dates before <22.01.2014 and after 04.01.2015])

    right now written as =AVERAGEIFS($D$3:$CQ$3;$D$5:$CQ$5;"";$D$2:$CQ$2; "OR(<22.01.2014; >04.01.2015)")

    but it does not work this way... must be some stupid mistake. Please, help!

    Thanks much,
    D

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: AVERAGEIFS with date range condition

    It seems like the problem with the syntax

    Try it like this

    =AVERAGEIFS($D$3:$CQ$3;$D$5:$CQ$5;"=""";$D$2:$CQ$2;"<22.01.2014";$D$2:$CQ$2;">04.01.2015")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    02-09-2015
    Location
    muc
    MS-Off Ver
    Ms 2013
    Posts
    5

    Re: AVERAGEIFS with date range condition

    Thanks a lot @AlKey,
    also gives #DIV/0 error

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: AVERAGEIFS with date range condition

    If your date ranges are using true dates, you may wish to use SUMPRODUCT instead to capture a real OR expression.

    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: AVERAGEIFS with date range condition

    another try

    =AVERAGEIFS($D$3:$CQ$3;$D$5:$CQ$5;"=""";$D$2:$CQ$2;">"&DATE(2014;1;22);$D$2:$CQ$2;"<"&DATE(2015;1;4))
    Last edited by AlKey; 02-09-2015 at 11:52 AM.

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: AVERAGEIFS with date range condition

    I'm not sure there's an intersection between the low and high range.

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: AVERAGEIFS with date range condition

    Quote Originally Posted by daffodil11 View Post
    I'm not sure there's an intersection between the low and high range.
    I think you are right. they need to be reversed.

  8. #8
    Registered User
    Join Date
    02-09-2015
    Location
    muc
    MS-Off Ver
    Ms 2013
    Posts
    5

    Re: AVERAGEIFS with date range condition

    nope does not work either
    sucks that excel gives no clue where the mistake may lie

  9. #9
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: AVERAGEIFS with date range condition

    Did you try the SUMPRODUCT method?

    AverageIF, SumIf, and CountIf are ready-made varieties of SUMPRODUCT to encourage the use of array enabled formulas, but as you've seen they lack in providing useful feedback for why they aren't working.

    On the other hand, SUMPRODUCT does produce useful outputs that can be readily debugged for points of failure. The most likely culprit is that your base formula is asking for the intersection between numbers that are both greater than X and less than X, and there are none.

    AverageIf logic follows the sum of values that meet criteria, divided by their count. Since there is no natural number that is simultaneously >x and <x, you'll have to use an expression that effectively applies OR logic, or you'll always be dividing by zero.

    I've attached an example illustrating the comparison.
    Attached Files Attached Files
    Last edited by daffodil11; 02-09-2015 at 12:13 PM.

  10. #10
    Registered User
    Join Date
    02-09-2015
    Location
    muc
    MS-Off Ver
    Ms 2013
    Posts
    5

    Re: AVERAGEIFS with date range condition

    i will try, thank you!

  11. #11
    Registered User
    Join Date
    02-09-2015
    Location
    muc
    MS-Off Ver
    Ms 2013
    Posts
    5

    Re: AVERAGEIFS with date range condition

    quick feedback:

    it worked as =SUMPRODUCT(--($D$5:$CQ$5="");(($D$2:$CQ$2<DATE1)+($D$2:$CQ$2>DATE2));($D$3:$CQ$3))/SUMPRODUCT(--($D$5:$CQ$5="");(($D$2:$CQ$2<DATE1)+($D$2:$CQ$2>DATE2)))

    thanks for help!

  12. #12
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: AVERAGEIFS with date range condition

    There we go! Well done!

+ 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. AVERAGEIFS Formula with Date Range and Matching a Name
    By luvnwatts6 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-09-2014, 12:47 PM
  2. How to count the date range with condition
    By 00itachi00 in forum Excel General
    Replies: 4
    Last Post: 08-03-2012, 07:29 AM
  3. Replies: 9
    Last Post: 02-20-2012, 07:46 PM
  4. Replies: 3
    Last Post: 12-16-2011, 10:55 AM
  5. COUNIF Date range and condition
    By nomadmoss in forum Excel General
    Replies: 1
    Last Post: 12-23-2009, 08:37 AM

Tags for this Thread

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