+ Reply to Thread
Results 1 to 6 of 6

How do I obtain the Average Values between 2 dates?

  1. #1
    Registered User
    Join Date
    06-23-2006
    Posts
    13

    How do I obtain the Average Values between 2 dates?

    I have 2 worksheets. One named Daily, one named weekly. The A columns of both sheets have dates. Daily has every business day (including holidays) and weekly has every Friday(including holidays). The B columns contain volume that coorelates with the dates. What I would like to do is take the Average values between 2 Fridays and put them into the weekly worksheet. I had success with the first week because I was only searching on one criteria, but when I tried to search between dates, no luck. This is the formula that worked for the first cell:
    {=AVERAGE(IF(Daily!$A$4:$A$604<=Weekly!A4,Daily!$B$4:$B$604))}


    Here is the formula I attempted the DID NOT work in calculating the daily average of one weeks voume.
    {=AVERAGE(IF(AND(Daily!$A$4:$A$604<=Weekly!A5,Daily!$A$4:$A$604>Weekly!A4),Daily!$B$4:$B$604))}

    Any ideas? FYI, I want to skip the blank cells(holidays) in my calculations.

    Thanks,

    Gimi

  2. #2
    Domenic
    Guest

    Re: How do I obtain the Average Values between 2 dates?

    Try...

    =AVERAGE(IF(Daily!$A$4:$A$604>Weekly!A4,IF(Daily!$A$4:$A$604
    <=Weekly!A5,Daily!$B$4:$B$604)))

    ....confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

    In article <gimiv.2a6qgb_1151620503.6322@excelforum-nospam.com>,
    gimiv <gimiv.2a6qgb_1151620503.6322@excelforum-nospam.com> wrote:

    > I have 2 worksheets. One named Daily, one named weekly. The A columns of
    > both sheets have dates. Daily has every business day (including
    > holidays) and weekly has every Friday(including holidays). The B
    > columns contain volume that coorelates with the dates. What I would
    > like to do is take the Average values between 2 Fridays and put them
    > into the weekly worksheet. I had success with the first week because I
    > was only searching on one criteria, but when I tried to search between
    > dates, no luck. This is the formula that worked for the first cell:
    > {=AVERAGE(IF(Daily!$A$4:$A$604<=Weekly!A4,Daily!$B$4:$B$604))}
    >
    >
    > Here is the formula I attempted the DID NOT work in calculating the
    > daily average of one weeks voume.
    > {=AVERAGE(IF(AND(Daily!$A$4:$A$604<=Weekly!A5,Daily!$A$4:$A$604>Weekly!A4),Dai
    > ly!$B$4:$B$604))}
    >
    > Any ideas? FYI, I want to skip the blank cells(holidays) in my
    > calculations.
    >
    > Thanks,
    >
    > Gimi


  3. #3
    Registered User
    Join Date
    06-23-2006
    Posts
    13
    That worked, excellent. Thanks Domenic. One last thing, how do I get it to ignore blank cells (holidays)

  4. #4
    Domenic
    Guest

    Re: How do I obtain the Average Values between 2 dates?

    Try...

    =AVERAGE(IF(Daily!$A$4:$A$604>Weekly!A4,IF(Daily!$A$4:$A$604
    <=Weekly!A5,IF(Daily!$B$4:$B$604<>"",Daily!$B$4:$B$604))))

    ....confirmed with CONTROL+SHIFT+ENTER.

    In article <gimiv.2a7xqn_1151676613.5039@excelforum-nospam.com>,
    gimiv <gimiv.2a7xqn_1151676613.5039@excelforum-nospam.com> wrote:

    > That worked, excellent. Thanks Domenic. One last thing, how do I get it
    > to ignore blank cells (holidays)


  5. #5
    Registered User
    Join Date
    06-23-2006
    Posts
    13
    It worked. Thanks again. One more thing. Is there a way to set it so that if there are noe values to calculate, you don't get the #DIV/0! error?

  6. #6
    Domenic
    Guest

    Re: How do I obtain the Average Values between 2 dates?

    Sure, try the following...

    Insert > Name > Define

    Name: BigNum

    Refers to: =9.99999999999999E+307

    Click Ok

    Then try...

    =LOOKUP(BigNum,CHOOSE({1,2},0,AVERAGE(IF(Daily!$A$4:$A$604>Weekly!A4,IF(D
    aily!$A$4:$A$604<=Weekly!A5,IF(Daily!$B$4:$B$604<>"",Daily!$B$4:$B$604)))
    )))

    ....confirmed with CONTROL+SHIFT+ENTER. The formula will return 0
    instead of #DIV/0!. If you'd like the cell to be blank, you can custom
    format the cell...

    Format > Cell > Number > Custom > Type: [=0]""

    Hope this helps!

    In article <gimiv.2a83rb_1151684407.5949@excelforum-nospam.com>,
    gimiv <gimiv.2a83rb_1151684407.5949@excelforum-nospam.com> wrote:

    > It worked. Thanks again. One more thing. Is there a way to set it so
    > that if there are noe values to calculate, you don't get the #DIV/0!
    > error?


+ 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