简体   繁体   English

如何将日期中的月份替换为特定月份?

[英]How to replace months in dates to specific month?

I have a list of dates from different months and I need to replace the months with specific month (December in this case). 我有不同月份的日期列表,需要用特定月份(在这种情况下为12月)替换月份。

I tried to convert date format to show month in words eg 01 for Jan. Then, used replace wizard to replace Jan to Dec. But it failed. 我尝试将日期格式转换为以单词显示月份,例如01表示Jan。然后,使用replace向导将Jan替换为Dec。但是失败。

For example:
Current Date  Expected Date
18/01/2018    18/12/2018
20/02/2018    20/12/2018
31/03/2018    31/12/2018
04/04/2018    04/12/2018
19/05/2019    19/12/2018

If the date are true dates then: 如果日期是真实日期,则:

=DATE(YEAR(A2),12,DAY(A2))

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM