Excel TEXT formula doesn't convert 'yyyy' to a year

前端 未结 9 2507
清歌不尽
清歌不尽 2021-02-19 05:00

I want to combine some text with a date in Excel 2013.

Let\'s say I have a cell A2 with a date like 30-10-2014. I tried to append the date after the text with t

相关标签:
9条回答
  • 2021-02-19 05:04

    All kudos go to @AxelRichter, thanks Axel!

    It looks like that if you have a Dutch Windows but an English version of Excel (2013) the formulas get mixed up. For example, I still have the English formula names like TEXT (which would be TEKST in Dutch) but still have to use a colon instead of a comma in the formula. The format_text value of TEXT still expects the Dutch format which is different for the year (jjjj instead of yyyy).

    So if you have a Dutch Windows and an English Excel version the correct formula for some text followed by a formatted date would be:

    ="Some text and a date: "&TEXT(A2;"dd-mm-jjjj")

    I hope Microsoft will fix this, this is very annoying!

    0 讨论(0)
  • 2021-02-19 05:04

    This issue is still there on Excel 2016 (or Office 365, if you may). It is caused by different language settings in Windows. This happens for languages that have different year symbols (dutch is 'jjjj', portuguese is 'aaaa'). If you're experiencing this problem, try using your local Windows language's year format.

    0 讨论(0)
  • 2021-02-19 05:05

    Excel here obviously fails. TEXT should be language agnostic.

    The workaround I found, especially if you have multiple cells to format:

    1. Calculate the desired date format in a hidden cell or white colored:

    =IF(TYPE(VALUE(TEXT(DATE_CELL;"YY")))=1;"DD.MM.YYYY";"ДД.ММ.ГГГГ")

    If you need, it can be extended to support multiple regions like:

    =IF(TYPE(VALUE(TEXT(DATE_CELL;"YY")))=1;"DD.MM.YYYY";IF(TYPE(VALUE(TEXT(DATE_CELL;"ГГ")))=1;"ДД.ММ.ГГГГ";"DD.MM.JJJJ"))

    1. On cells where you need dates, use previous cell as second parameter:

    ="Date: " & TEXT(DATE_CELL; FORMAT_CELL)

    0 讨论(0)
  • 2021-02-19 05:10

    You can now use 'e' instead of 'yyyy'. The e is the universal version of yyyy a

    0 讨论(0)
  • 2021-02-19 05:11

    we have the same issue at our work and I found that if I cannot influence the localization of the windows then I use a formula which in your case looks like:

    ="Some text and a date: "&TEXT(A2;"dd-mm-")&YEAR(A2)
    

    It is funny that "dd" and "mm" is the same.

    0 讨论(0)
  • 2021-02-19 05:11

    Solution: To check if "jjjj" format is working:

    The date you want to display in a certain format is in A1

    In cell A2 link a cel to the cel with the date you want displayed in a certain format with the following formula:

    =TEXT(A1;"dd/mm/jjjj")
    

    In a 3rd cel you then place the following formula:

    =IF(RIGHT(A2;4)="jjjj";TEXT(A1;"yyyy");TEXT(A1;"jjjj"))
    

    If the 4 digits from the right are "jjjj" this formula will display the date formatted as "yyyy" else the formatting "jjjj" will be used.

    0 讨论(0)
提交回复
热议问题