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

前端 未结 9 2624
清歌不尽
清歌不尽 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: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)

提交回复
热议问题