SumIfs Current Month
Hello,
I am trying to sum hours noted in the children of a row (Total Hours per Project) if the current month is noted in another cell (Week Ending With). Here is what I have:
=SUMIFS(CHILDREN([Total Hours per Project]1, [Week Ending With]:[Week Ending With], MONTH(@cell) = MONTH(TODAY()))
and I continue to receive a result of #unparseable.
Thank you in advance for your help!
Ally
Comments
-
Hi Ally,
Unfortunately, SUMIFS does not work with dates. Crazy huh?
However, that's not why you're receiving an error. SUMIFS also need to sum and compare ranges of the same size. Because you're using a variable SUM range (children of [Total Hours per Project]1) and the whole Week Ending With column, it is falling in a big heap.
You're kind of on the right track though. We just need to do a few things to help Smartsheet along:
- Create another Parent Count column (you can hide it if you wish) that has the following formula: =COUNT(PARENT([Total Hours per Project]1))
- Then drag it down the column as far as your data extends.
- This now means we can compare apples with apples as you can sum the whole Total Hours per Project column based on criteria in the Parent Count column we just created (i.e. a count of 1 indicating it's a child row)
- Now assuming that you're using a US date format (MM/DD/YY), we can cheat SUMIFS into working with dates by using the LEFT and MID functions to extract the month from your Week Ending With column.
- Create a new Month column (that can also be hidden) and enter this formula: =IF(LEFT([Week Ending With]1, 2) < 10, MID([Week Ending With]1, 2, 1), LEFT([Start Date]2, 2)). This formula needs to account for the leading 0 displayed for January - September (groan).
- Drag this formula down the column as far as your data extends.
Now that we've set things up, your end formula will end up looking something like this:
=SUMIFS([Total Hours per Project]:[Total Hours per Project], [Parent Count]:[Parent Count], 1, Month:Month, VALUE(@cell) = MONTH(TODAY()))Hope this helps .
Kind regards,
Chris McKay
-
Chris,
Wow, I don't know if I ever would have come up with your recommendations, so thanks for putting the time in to write all of that out! I created the Parent count column and dragged your recommended formula throughout the appropriate fields on the sheet. Then I added a Month column and entered your suggested formula. The only issue (so far) that I'm running into is that the formula you recommended for the Month column: =IF(LEFT([Week Ending With]1, 2) < 10, MID([Week Ending With]1, 2, 1), LEFT([Start Date]2, 2)) is returning an #UNPARSEABLE value. Any ideas what needs to be changed?
Thanks so much for your help!
Ally
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
- 495 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!