I'm trying to average a range of values if its associated date falls between two specified dates. The following function works:
AVERAGEIFS($1:$1,$2:$2,">=1/1/2014",$2:$2,"<=1/2/2014")
...in this case the values that you want to average are in row 1 and the dates that are associated with it are in row 2.
However, in this case I'm explicitly stating the date range in my formula (">=1/1/2014" and "<=1/2/2014"). Is there any way to create a similar formula that allows me to reference date cells to determine my date range instead of having to explicitly state the dates in the formula itself???
Formula Break down Here, IF((B5:B15>=B5)*(B5:B15<=B13),D5:D15) formula will yield the result as {100;200;300;400;500;600;700;800;900;FALSE;FALSE}, where it took all the sale values within our specified range. Then AVERAGE({100;200;300;400;500;600;700;800;900;FALSE;FALSE}) will give us the output 500.
The VLOOKUP function matches the largest date that is smaller or equal to the lookup date. If the lookup date is 3-31-2009 it will match 3-31-2009 found in cell B4 and return the corresponding value in column C (cell C4). In this case nothing, cell C4 is empty. This applies to all date ranges in column B.
The AVERAGEIFS function is a premade function in Excel, which calculates the average of a range based on one or more true or false condition.
you can use the following, by putting the start date and the end date in another cell and refer to them in your formula:
=AVERAGEIFS($1:$1,$2:$2,">="&$B$4,$2:$2,"<="&$B$5)
with the following example:
Assuming your two dates are in E5 and F5 you could do it like this:
=AVERAGEIFS($1:$1,$2:$2,">="&E5,$2:$2,"<="&F5)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With