+ Reply to Thread
Results 1 to 3 of 3

Average if between two dates...

Hybrid View

  1. #1
    Registered User
    Join Date
    11-12-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    48

    Average if between two dates...

    Alright I've been screwing my brain with over thinking for the last couple hours. I'm gonna try and see if someone here can figure out what I'm missing..

    Attached is a tiny excel file. It has two sheets. Sheet1 has a column (C) with dates ranging from 2/14/13 until 3/6/13. The next column (D) has random data next to it.

    On Sheet2, I have two fields that call for start date and end date.

    What I am looking for, it at all possible, is to set a cell value based on the average of the data between the cell start dates.

    Example: If I set my start date to 2/21/13 and my end date to 2/27/13, I want a cell to return the average, which is 6.714286...

    The formula I was working on looks like this:

    =AVERAGEIFS(Sheet1!D4:D24,Sheet1!D4:D24,(VLOOKUP(E4,Sheet1!C4:D24,1,FALSE)>=E4),Sheet1!D4:D24,(VLOOKUP(E4,Sheet1!C4:D24,1,FALSE)<=E5))

    It returns a DIV/0.

    Anyone with an outside eye that can see what I'm doing wrong, which might just be everything?

    Any help is appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,994

    Re: Average if between two dates...

    Formula: copy to clipboard
    =AVERAGEIFS(Sheet1!D4:D24,Sheet1!C4:C24,">="&E4,Sheet1!C4:C24,"<=" &E5)
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    11-12-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Average if between two dates...

    I had about a whole 5% of it right.. Man I way over complicated this! Thank you so much! If you ever get to SE Michigan, you have a free drink on me.. Or a bag of candy... Or something... I don't really know but thanks!

+ 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