Convert date format to "YYYY.MM.DD" in formula that combines date and text
Is there a way to do something like the excel formula =TEXT(TODAY(),"YYYY.MM.DD") in SmartSheet to allow a specific date format to appear in the output of a formula, regardless of the user's regional settings?
All of our date columns have been set to the YYYY.MM.DD format, but we have formula columns that combine dates from the date columns with text. Those formula columns cannot have the date format applied, so the dates they output just take on the format of the user's regional settings. Since we have users in different regions, we would like all dates from formulas to be displayed as YYYY.MM.DD if possible, but I can't seem to figure out how to do this.
Here's an example of the formula:
=IF([DateColumn]@row <= TODAY(), [DateColumn]@row + " - " + "Sample Text", "")
Any help would be much appreciated, thanks!
Comments
-
Seems like that should work, but I just tried it and I get an Invalid Data Type error. I tried changing the Column Type to Date, and also to Text/Number but get the error either way.
-
Is [Date Column] a date type?
I have been experiencing issues today with date type columns and formulas as well, so it could be a bug.
-
Yes, that is a Date type column. This isn't an urgent request fro the users so I can try again tomorrow and next week to see if it starts working. Thanks!
-
I just tested it, and it worked for me... Double check everything. Column names and types. If anything being referenced is populated by another formula, make sure that formula isn't populating a text string instead of an actual date, etc.
-
It indeed does work for me now that I fixed a missing close parenthesis that was causing the issue.
Thanks for checking and verifying that it should work for me!
-
-
I have the same need to get the latest modified date from a "Modified" column, something like the MAX function and then return it in a European format not as an US format. (I don't want to change my region)
I tried your formula and it says invalid operation. Not sure what i did wrong. This is the formula:
=IF(Modified@row <= TODAY(), DAY(Modified@row + "/" + MONTH(Modified@row + "/" + YEAR(Modified@row))))
-
@Tony Oxa I had a go with your formula and got it working with a couple of brackets moved about, although I'm using dots rather than forward slash:
=IF(Modified@row <= TODAY(), YEAR(Modified@row) + "." + MONTH(Modified@row) + "." + DAY(Modified@row) + " - " + "Sample Text", "")
@Paul Newcome Can I use your beautiful big brain to get this to work with a two digit month? So today would be 2024.03.21 (rather than what I'm currently getting, which is 2024.3.21).
-
@Kirstine Here's how I "pre-fill" zeros:
=IF(Modified@row <= TODAY(), YEAR(Modified@row) + "." + RIGHT("00" + MONTH(Modified@row), 2) + "." + DAY(Modified@row) + " - " + "Sample Text", "")
Basically you use the RIGHT function, "add" however many zeros you want the final digit count to be to the start of the number, then use the total number of digits for the second part of the RIGHT function.
Technically you could use a single zero appended to the beginning of the month number, but I find it easier for me to remember if I just use two and two if I want a total of two digits.
-
Loving your work as always @Paul Newcome! Thank you! 😍
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.2K Get Help
- 444 Global Discussions
- 142 Industry Talk
- 473 Announcements
- 5K Ideas & Feature Requests
- 83 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 489 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!