When Counting by week how do I only include the current year?
My formula for counting by week is:
=COUNTIFS({BBS Data Range 1}, IFERROR(WEEKNUMBER(@cell), 0) = WEEKNUMBER(TODAY()), {Staff}, ="John Smith")
This works pretty well but it is counting events that occured in previous years. I only want to include THIS YEAR in the count.
Thanks in Advance
Best Answer
-
=COUNTIFS({BBS Data Range 1}, IFERROR(WEEKNUMBER(@cell), 0) = WEEKNUMBER(TODAY()), {BBS Data Range 1}, YEAR(@cell) = YEAR(TODAY()), {Staff}, =Staff@Row)
This ended up working, couldnt have arrived at this without your help.
Thanks!
Answers
-
hi @Drew Wort,
if you want to have dynamic year you need to create two helping columns one will be date and you keep there =today(); and second will be =year(todays)…. in this case the second column will take the year from todays column always.
hope this helps.
The Real Smartsheet Enthusiast
Is there anything else we can help you with? - book your time.
MASA Consult - Your Aligned Smartsheet Gold Partner
Find us on LinkedIn & Check our Smartsheet Solutions!
Tag my name: @kowal if you want me to respond :)
-
Your date criteria would change to
=AND(IFERROR(WEEKNUMBER(@cell), 0) = WEEKNUMBER(TODAY()), IFERROR(YEAR(@cell), 0) = YEAR(TODAY())
-
=COUNTIFS({BBS Data Range 1}, =AND(IFERROR(WEEKNUMBER(@cell ), 0) = WEEKNUMBER(TODAY()), IFERROR(YEAR(@cell ), 0) = YEAR(TODAY()), {Staff}, ="John Smith"))
I tried this to no avail. Am I missing something? I keep getting invalid data type/
-
Sorry. No equals before the AND function.
-
=COUNTIFS({BBS Data Range 1}, IFERROR(WEEKNUMBER(@cell), 0) = WEEKNUMBER(TODAY()), {BBS Data Range 1}, YEAR(@cell) = YEAR(TODAY()), {Staff}, =Staff@Row)
This ended up working, couldnt have arrived at this without your help.
Thanks!
-
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.7K Get Help
- 438 Global Discussions
- 152 Industry Talk
- 497 Announcements
- 5.3K Ideas & Feature Requests
- 85 Brandfolder
- 155 Just for fun
- 77 Community Job Board
- 509 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 307 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!