Excel Date Formatting

后端 未结 5 1933
攒了一身酷
攒了一身酷 2020-12-06 16:19

I have a large imported csv file containing American Dates in a column. I want to change these dates to UK format (dd/mm/yyyy) using a code. The problem is the

5条回答
  •  不思量自难忘°
    2020-12-06 16:53

    You can use the DATEVALUE function to convert the date strings into Excel data values, and then create a custom date format to display the date values in U.K. format.

    Assuming that the first date string is in cell A1, the following function call will turn the string into a date value.

      =DATEVALUE(A1)
    

    You can create the custom format dd/mm/yyyy;@ by right-clicking on the cell, choosing Format Cells, Number, Custom and entering the format in the Type field.

    Working with date values instead of date strings will allow you to change the displayed format without having to do string operations to rearrange the date elements. It will also make it possible to do date arithmetic, should that need arise.

提交回复
热议问题