Excel: Average date difference of a range


Seeking help on calculating the average date difference of a range. I thought the best approach would be to use a sumifs, followed by an average however sumifs does't total the numeric date.

See the attached spreadsheet. How would I find the average date difference for dates within a given range?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


pls try

Open in new window

dabug80Author Commented:
Thanks Rgonzo.

I have never heard of Averageifs.

I wish to change the column references to full columns (e.g C:C), doing this doesn't work with averages, so I will need to define the active cell range. Is there an easy way to do this with a growing number of rows?
pls try


Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Try the formula in the attached file.  Similar to Rgonzo's but take into account that column C had your data.  Rearranged the data a bit and assumed you wanted to fill in the formula across your dates for each pair of dates (week)
Rob HensonFinance AnalystCommented:
Alternative, add a duration column to the list with simple formula "Delivery Date" less "Approved Date". You can then do the Averageifs formula on this column.

Assuming Duration in column D, formula in B14 and then copied across:


You could adjust the duration to only include working days if so required.
Rob HensonFinance AnalystCommented:
To overcome the expanding range, convert the list to a table; then the above formula will become:


Rob H
Rob HensonFinance AnalystCommented:
Now that is bizarre, I was going to comment on RGOnzo's formula being mathematically incorrect but it does actually give the same results as I get with the formula I posted.

Syntax of mine is  AVERAGE(Date 1 - Date 2) ie Average duration

whereas yours are looking at (Sum of Date Range1/Count of DateRange1)  - (Sum of Date Range2/Count of DateRange2);  (ie Average Date1 - Average Date2)

I was always of the opinion that Averages and Products had to be done at the source level to ensure that the placement of the operators ( * or /) were in the right place but it seems to not matter in this case.
Rob HensonFinance AnalystCommented:
Just looked at the file uploaded by xtermie and I see they have done the same as me, calculated duration and then done the average of that. Apologies to xtermie if it seemed I was copying. No points to me for that part, maybe just for the Table suggestion.

Slight difference with my suggestion is that I have used the IFERROR function.

The syntax for that being: IFERROR(Formula,False)

Whereas xtermie has used combination of IF and ISERROR

The syntax for that being IF(ISERROR(Formula),False,Formula)
Hey Rob, no need to apologize, we are probably just thinking alike :)
Hopefully dabug80 will find our suggestions/solutions helpful and will resolve their issue.
dabug80Author Commented:
This is an excellent solution. It's perfect as it doesn't use an additional helper column (which I can't add due to a CSV dump). Thanks for your great help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.