简体   繁体   English

将日期范围自动填充到excel单元格中

[英]Autofill date range into excel Cell

I want to insert a date range into my excel sheet. 我想将日期范围插入到我的Excel工作表中。 One cell shall contain a date range like this one. 一个单元格应包含这样的日期范围。

  1. Feb - 6. Feb Or 2月-6月6日或

1-Feb to 6-Feb Or 1月2日至6月2日或

1st Feb to 6th Feb 2月1日至2月6日

Then i want to drag it and autofill it for the rest of the year. 然后,我想将其拖动并自动填充一年的剩余时间。

You can do this by starting with two separate columns, putting in the appropriate dates side by side and then autofilling down for the year. 您可以通过从两个单独的列开始,并排放置适当的日期,然后自动填写年份来做到这一点。 Then in the third columns put in this formula '=TEXT(A2,"mmm d")&"-"&TEXT(B2,"mmm d")' this will give you the format of 'feb 1-feb 6.' 然后在此公式的第三列中输入'= TEXT(A2,“ mmm d”)&“-”&TEXT(B2,“ mmm d”)',这将为您提供'feb 1-feb 6'的格式。 You can adjust the "mmm d" portion of the formula to change the format. 您可以调整公式的“ mmm d”部分以更改格式。 Now autofill the third column down. 现在,自动向下填充第三列。

If you want to get rid of the original two columns, you can select the third column, hit 'ctrl + C' and then 'Ctrl + alt + V' and select values. 如果要摆脱原来的两列,则可以选择第三列,按“ Ctrl + C”,然后按“ Ctrl + alt + V”并选择值。 After doing this you can delete the other two columns without affecting your new column. 完成此操作后,您可以删除其他两列而不会影响新列。

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

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