How can I get a 2 digit month to appear with the following formula
Here is the current formula.
=IFERROR(YEAR([Close Date]@row) + "-" + MONTH([Close Date]@row), " ").
The results of this formula are causing sorting errors. I would like the result when the the month is less than 10 to appear with 2 digits. For example, the current result for September 2022 is 2022-9. I would like it to appear as 2022-09. I tried adding an IF statement on the MONTH, but could not get it to work.
Best Answer
-
Hi, Matt,
Add "0" to the expression and then take the 2 right-most characters...
RIGHT("0" + ___ , 2)
RIGHT( "0" + MONTH([Close Date]@row), 2)
Cheers!
Answers
-
Hi, Matt,
Add "0" to the expression and then take the 2 right-most characters...
RIGHT("0" + ___ , 2)
RIGHT( "0" + MONTH([Close Date]@row), 2)
Cheers!
-
Good morning,
Yes, this works perfectly! Thank you!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.9K Get Help
- 379 Global Discussions
- 210 Industry Talk
- 441 Announcements
- 4.5K Ideas & Feature Requests
- 139 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 300 Events
- 33 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!