# How to calculate the Average number of days based on a range with a date criteria?

Options

I am trying to write a formula for calculating the average number of days in one range based on anything added to the sheet post July 1 2020. I have tried several combinations. I can get a simple AVERAGE of the range for the whole sheet but need to specify only average the data after July 1.

Works and provides average for entire sheet:

=AVERAGEIF([Days to Complete]:[Days to Complete]

Does not work and produces an uparseable error:

=AVERAGEIF(COLLECT([Submitted Date]:[Submitted Date], [Submitted Date]:[Submitted Date], > DATE(2020, 7, 1))[Days to Complete]:[Days to Complete],

Any suggestions?

• ✭✭✭✭✭✭
edited 01/04/23
Options

Try this

=AVG(COLLECT([Days to Complete]:[Days to Complete], [Submitted Date]:[Submitted Date], ISDATE(@cell), [Submitted Date]:[Submitted Date], > DATE(2020, 7, 1))

Kelly

• Options

Thank you for the response. My apologies for the late reply.

This formula provides and unparseable error. I will keep working on it.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!