# Average values if the associated time of occurence falls within a certain time range

1. ## Average values if the associated time of occurence falls within a certain time range

Please refer to the attachment. I am trying to average the data in the Y column, if the times fall into the range between column R and S. I am having trouble with the averageif function. Is there a better way to parse through column W, check if the values fall between the ranges of S and R, and if they do, average the associated values in column Y?

Thanks!

2. ## Re: Average values if the associated time of occurence falls within a certain time range

it isn't ideal to work from jpgs, but I tried to enter some points to see what you are attempting. I guess I don't understand what it is you are saying should be greater than R2 and less than S2.
However, have you tried to use an If(and(whatever it is you want to compare>R2,same<S2),Average(W:W,Y:Y)?

3. ## Re: Average values if the associated time of occurence falls within a certain time range

If the times in column W are in the range of R2 and S2, I would like to average the values in column Y that are associated with the times in W. Then the averaged value should be returned in T2.

4. ## Re: Average values if the associated time of occurence falls within a certain time range

Well, i'm done, got me. But maybe for the next person and to help you define it a little more, you essentially want only the times in column W that are greater than R2 and less than S2 to be averaged and any times that are outside of those parameters to be excluded from the average, right?

5. ## Re: Average values if the associated time of occurence falls within a certain time range

You're right on. But I don't want to average the times that fall within the range, I would like to average the values in column Y that are associated with the times in column W. Thanks for the help.

6. ## Re: Average values if the associated time of occurence falls within a certain time range

=AVERAGEIF(INDEX(B3:B27,MATCH(\$H\$3,B3:B27,0)):INDEX(B3:B27,MATCH(\$I\$3,B3:B27,0)),">0",D3:D27)

my latest attempt, to no avail

#### Thread Information

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### 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