SUMIF within the last 30 days?
I am trying to sum the totals from another sheet that fall within the last 30 days. I've tried the "TODAY(-30) function but can't get it to work correctly. I'm assuming I need to add something to this formula that is currently giving me an all time total:
=SUMIF({Flight Activity Report Range 1}, MATCH(PILOT@row, {Flight Activity Report Range 2}, 0))
Answers
-
Hi. Do you have a date field in one of your sheets? You'll need to convert this to a SUMIFS, and include the date field as part of your calculation.
Let's say your Flight Activity Report looks like this:
On your summary sheet, where you are calculating flight time in last 30 days, you can use this formula:
=SUMIFS({Flight Activity Report Flight Minutes}, {Flight Activity Report Pilot}, Pilot@row, {Flight Activity Report Flight Date}, >=TODAY(-30))
Placing this formula in the "Minutes Flown in Last 30 Days" column will calculate the total flight time for each pilot in the Pilot column for the past 30 days.
You can alter this to suit whatever columns you're working, but I encourage your to name your cross-reference ranges instead of using Smartsheet's default values of "Range 1", "Range 2", etc. That way, you can more easily find errors in your formulas and you can visually track the logic of them later.
-
That appears to have worked. Thx!
-
Would you mind explaining how to rename the cross sheet references? Everytime I try and change from the generic "Range 1, Range 2" etc., The formula doesn't work anymore.
Thx!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!