BradS
BradS

Reputation: 149

how to calculate average ages between two dates in excel

I have a column of DNR dates (DATECOL) and a column of DNR ages (AGECOL), and I'd like to find the AVERAGE age within AGECOL between a specific date period

Cells B5 and C5 is my fixed date period that I'd like to search between.

I have tried using the below and tried sumproduct, but I'm not getting anywhere. The below doesn't get rejected, but it doesn't show the average age of the ages between the dates.

=COUNTIFS(DATECOL,">="&B5,DATECOL,"<="&C5,AGECOL,AVERAGE(AGECOL))

I can get the DATECOL to work on its own, and AVERAGE(AGECOL), but I can join them to get the result I need.

Upvotes: 0

Views: 212

Answers (1)

Scott Craner
Scott Craner

Reputation: 152450

Use AVERAGEIFS:

=AVERAGEIFS(AGECOL,DATECOL,">="&B5,DATECOL,"<="&C5)

Upvotes: 1

Related Questions