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, "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, "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 here.
Additional Resources
The following tutorials explain how to perform other common tasks in Excel:
How to Calculate Average If Between Two Values in Excel
How to Calculate Average If Cell Contains Text in Excel
How to Calculate a Cumulative Average in Excel
How to Find Weighted Moving Averages in Excel