Forum Discussion
catsrock1023
Jun 01, 2021Copper Contributor
Return current date for year
I need some help building a formula. I need to return the current year of a date in a cell in the YYYY-MM-DD format. For example, in one cell I have 1997-11-10 and I need it to return 2021-11-10 in a...
PeterBartholomew1
Jun 01, 2021Silver Contributor
I don't fully understand where the problem arises. Excel formulas accept date serial numbers but with the DATEVALUE function it will also accept formats appropriate to the machine localisation which should include ISO standard dates. So
= DATE( 2021, MONTH(DATEVALUE(B2)), DAY(DATEVALUE(B2)) )
should give a serial date that can be formatted. As an alternative if the cycle is text to text one could use
= LET(
old, DATEVALUE(oldDate),
mnth, MONTH(old),
d, DAY(old),
current, DATE( 2021, mnth, d),
TEXT(current,"YYY-MM-DD"))
SergeiBaklan
Jun 01, 2021Diamond Contributor
That's not Excel, that is this app https://generalcaster.app/website/documentation/formula/ which uses formulas as in Excel, but not all and by bit different way.
- PeterBartholomew1Jun 01, 2021Silver ContributorThanks. I had picked up that another system came into the picture but I (wrongly) assumed it was an import/export issue.