Date-Formatting in TEXT formula independent from used language in Excel

If the only problem is sharing it with your Polish co-worker, then you can simply use the international placeholder “e” to replace “YYYY”:

=TEXT(A1,"e-MM-DD")

Now, while this would work fine for your co-worker in Poland, there are countries where “m” and “d” would also need replacement. If in general we need to return the locale “Y”, “M” or “D” equivalent you could create three named formulas using the name manager:

  • 1st: Create name called YT and refer to =INDEX(GET.WORKSPACE(37),19)
  • 2nd: Create name called MT and refer to =INDEX(GET.WORKSPACE(37),20)
  • 3rd: Create name called DT and refer to =INDEX(GET.WORKSPACE(37),21)

Now you can use a reference to these names through:

=TEXT(A1,REPT(YT,4)&"-"&REPT(MT,2)&"-"&REPT(DT,2))

NOTE: Depending on which version of Excel you use it could be necessary to:
Enable Excel 4.0 macros when VBA macros are enabled in the Trust Center

Leave a Comment