Median & Sum of Multiple Columns in Date Range
Hello,
I am attempting to write a formula to display the median of 6 columns, only if they contain data within the last 7 days per the date column. I also need to display the sum of the same 6 columns if they contain data within the last 7 days per the date column.
I've tried what seems to be an endless variety of formulas to try and make this happen and keep running into unparsable or incorrect argument errors.
Does anyone know if this is possible and if so, how to do it?
Thank you,
Miranda
Answers
-
Just do a SUMIFS a COUNTIFS and the median is just SUMIFS/COUNTIFS right? its easy.
But it sounds like you are
probablyusing incorrect formula syntax. You haven't given any details so it'd be impossible to say what the issue is. -
The issue is that you are trying to pull in six columns of data based on a single column which means your range sizes within the same function do not match. One is a single column and the other range is a set of six columns.
My suggestion would be to use two helper columns. One for the sum and one for the median to be output on each individual row (if the date is within the last 7 days).
Sum:
=IF(AND([Date Column]@row>= TODAY(-7), [Date Column]@row<= TODAY()), SUM([1st Column]@row:[Last Column]@row))
Median:
=IF(AND([Date Column]@row>= TODAY(-7), [Date Column]@row<= TODAY()), AVG([1st Column]@row:[Last Column]@row))
Then you can run a basic SUM or AVG function (as appropriate) on these helper columns ignoring the date criteria since the only rows that will have data are ones that already meet the date criteria.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.8K Get Help
- 406 Global Discussions
- 218 Industry Talk
- 457 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 136 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 297 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!