If Month = 12
I am trying to get a formula to count the number of instances that match certain criteria if it was created last month in the current year, however, I don't really know how to add in if last month = 12 then look for last year.
In the formula below [Last Year]1 has a value of 2019 (formula to show whatever last year was)
=COUNTIFS({Nature}, [Primary Column]3, {Branch}, $[SOURCE FROM]$2, {Injury Date}, IF(AND(MONTH(@cell) = 12, YEAR(@cell) = [Last Year]1), 1, 0))
Answers
-
Ramzi Khuri - Principal Consultant @ Cedar Tree Consulting (www.cedartreeconsulting.com)
Feel free to email me: ramzi@cedartreeconsulting.com
💡 If this post helped you out, please help the Community by marking it as the accepted answer/helpful.
-
even doing that I am still getting an error
-
No need for that IF in the function:
=COUNTIF(Dealer1, AND(MONTH(@cell) = 12, YEAR(@cell) = YEAR(TODAY()) - 1))
Cheers,
Ramzi
Ramzi Khuri - Principal Consultant @ Cedar Tree Consulting (www.cedartreeconsulting.com)
Feel free to email me: ramzi@cedartreeconsulting.com
💡 If this post helped you out, please help the Community by marking it as the accepted answer/helpful.
-
I am actually looking for a countif formula the takes in to account that January is a month and December is the month previous.
The below is how I have everything set up, i just need to somehow add in a statement that if the month is January to go back and look at December of the previous year
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 58 Community Job Board
- 463 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!