jaredcott6
May 02, 2023Copper Contributor
Automate an averaging formula by date
Hello, I am running into an issue with a spreadsheet I am currently working on. I have data from the last 30 days and need to figure out how to insert the date into the function without manually doing it every time. The function I am currently using looks like this:
=AVERAGEIFS(AVERAGE RANGE, CRITERIA RANGE1, ">=" & DATE(YEAR,MONTH,DAY),CRITERIA RANGE2, "<=" & DATE(YEAR,MONTH,DAY))
EX:
=AVERAGEIFS(F:F,E:E, ">=" & DATE(2023,03,30),E:E, "<=" & DATE(2023,03,30))
I am sure there is a more simple way to do this. If you need more info let me know. Thank you all!
If you want to average over the last 30 days, use
=AVERAGEIFS(average_range, date_range, ">"&TODAY()-30, date_range, "<="&TODAY())