Date formula
Hello!
I currently have 2 columns on my sheet, one where I enter date processed and date expired which has a formula to calculate 1 year expiration from date processed. I have been asked that no matter what date I process, it needs to expire the last date of that month. So for example,
- date processed = 9/5/23
- date expired should be 9/30/23
How would I write this formula AND how would this formula know the actual last day of the month, especially leap year?
Any assistance is appreciated as I do not want to enter this in manually each time.
Thanks!
Best Answer
-
@jgneely72151 I forgot to deal with December. The formula should be:
=IF(MONTH([Date Processed]@row) = 12, DATE(YEAR([Date Processed]@row) + 1, 12, 31), DATE(YEAR([Date Processed]@row) + 1, MONTH([Date Processed]@row) + 1, 1) - 1)
Answers
-
Will this work?
=DATE(YEAR([Date Processed]@row) + 1, MONTH([Date Processed]@row) + 1, 1) - 1
-
@jgneely72151 I forgot to deal with December. The formula should be:
=IF(MONTH([Date Processed]@row) = 12, DATE(YEAR([Date Processed]@row) + 1, 12, 31), DATE(YEAR([Date Processed]@row) + 1, MONTH([Date Processed]@row) + 1, 1) - 1)
-
thank you so much...it worked
🤩
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.8K Get Help
- 406 Global Discussions
- 218 Industry Talk
- 457 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 136 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 297 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!