TODAY() Function stopped working
I have the following formula for determining if an item was used in the last month. Example: between 12/21/2022, and 01/21/2023.
=IF(AND([Date Entered]@row < DATE(YEAR(TODAY()), MONTH(TODAY()), 21), [Date Entered]@row >= DATE(YEAR(TODAY()), MONTH(TODAY()) - 1, 21)), 1, 0)
At some point it has stopped working. It was in a checkbox column and determined if items were automatically sent to finance or not.
Does anyone know why it stopped working, or how to fix it?
Thanks
Best Answer
-
It is because of the bold portion:
=IF(AND([Date Entered]@row < DATE(YEAR(TODAY()), MONTH(TODAY()), 21), [Date Entered]@row >= DATE(YEAR(TODAY()), MONTH(TODAY()) - 1, 21)), 1, 0)
1 minus 1 equals 0. There is no month zero. Try this:
=IF(AND([Date Entered]@row < DATE(YEAR(TODAY()), MONTH(TODAY()), 21), [Date Entered]@row >= DATE(YEAR(TODAY()), IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), 21)), 1, 0)
Answers
-
It is because of the bold portion:
=IF(AND([Date Entered]@row < DATE(YEAR(TODAY()), MONTH(TODAY()), 21), [Date Entered]@row >= DATE(YEAR(TODAY()), MONTH(TODAY()) - 1, 21)), 1, 0)
1 minus 1 equals 0. There is no month zero. Try this:
=IF(AND([Date Entered]@row < DATE(YEAR(TODAY()), MONTH(TODAY()), 21), [Date Entered]@row >= DATE(YEAR(TODAY()), IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), 21)), 1, 0)
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.6K Get Help
- 433 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.9K Ideas & Feature Requests
- 143 Brandfolder
- 147 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 298 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!