How to work on a formula to display 2 digit value?
With reference to the above, we are trying to create a Serial Number with a few combination of data. One of it is the month and year submitted.
I am using the MONTH(@cell) and YEAR(@cell) formula (as shown in the screenshot) to obtain the month and year.
Is there any formula to convert it into a 2 digit value as follows?
Month: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12
Year: 22 for 2022, 23 for 2023 ...
Appreciate assistance.
Best Answer
-
You could try the following,
For Month column:
=RIGHT(100 + MONTH([Date Submitted]@row), 2)
This will add 1 at the beginning of the number, and then strip the first character, so this way it will trick the sheet into displaying 2 digit long including the leading 0.
For the Year column:
=RIGHT(YEAR([Date Submitted]@row), 2)
This should keep the last 2 digits of the 4-digit year.
Kevin
Answers
-
You could try the following,
For Month column:
=RIGHT(100 + MONTH([Date Submitted]@row), 2)
This will add 1 at the beginning of the number, and then strip the first character, so this way it will trick the sheet into displaying 2 digit long including the leading 0.
For the Year column:
=RIGHT(YEAR([Date Submitted]@row), 2)
This should keep the last 2 digits of the 4-digit year.
Kevin
-
thanks @Kevin St-Pierre . The formula works. I know it can be done. Just don't know how.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!