How to Calculate the Average of a Row if the Date is Between X and Y?

To calculate the average of a row if the date is between X and Y, you would need to add together all of the values within the row that are between the given dates X and Y, and then divide the sum of these values by the number of values within the row that are between the given dates. This will give you the average of the row within the specified dates.


You can use the following formula to calculate the average in Excel only for cells that fall between two specific dates:

=AVERAGEIFS(B2:B11, A2:A11, "<=1/15/2022", A2:A11, ">=1/5/2022")

This particular formula calculates the average value of cells in range B2:B11 where the date in the range A2:A11 is between 1/5/2022 and 1/15/2022.

The following example show  how to use this formula in practice.

Example: Calculate Average If Between Two Dates

Suppose we have the following dataset that shows the total sales made by some company on various dates:

We can use the following formula to calculate the average daily sales between 1/5/2022 and 1/15/2022:

=AVERAGEIFS(B2:B11, A2:A11, "<=1/15/2022", A2:A11, ">=1/5/2022")

The following screenshot shows how to use this formula in practice:

The average daily sales between 1/5/2022 and 1/15/2022 is 7.2.

We can manually verify that this is correct:

Average Daily Sales = (7 + 7 + 8 + 6 + 8) / 5 = 7.2.

Note: You can find the complete documentation for the AVERAGEIFS function .

x