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
- 62.9K Get Help
- 376 Global Discussions
- 207 Industry Talk
- 440 Announcements
- 4.5K Ideas & Feature Requests
- 139 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 284 Events
- 33 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!