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

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

提交回复
热议问题