change date format of cell in excel from dd.mm.yyy

2019-03-01 09:56发布

I have been searching it for an hour but unfortunately nothing found that actually work. I have an excel sheet with a column having date in it. Current date format is dd.mm.yyyy but I want to change date format to yyyy/mm/dd for entire cell. Any help will be appreciated.

4条回答
▲ chillily
2楼-- · 2019-03-01 10:43

Nothing wrong with your format i.e. yyyy/mm/dd. You can use:

=TEXT(A1,"yyyy/mm/dd")

enter image description here

Update

A comment was made on this question re the TEXT function converting a date-serial to text. It will still be possible to apply date functions to the output of the TEXT function and get an output. E.g. here we can see WEEKDAY returning a result on the value of B1 (which in turn is formatting A1): enter image description here

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-03-01 10:50

The problem is that your date is a text string, so changing the cell number format won't have any effect.

One method of convert the dates in place to "real" dates is to use the Text to Columns wizard.

  • Select your date(s).

  • Select the Text to Columns option on the Data Tools Tab of the Data Ribbon:

enter image description here

  • At Step 1, select "Fixed Width" then "Next"

enter image description here

  • Step 2 is irrelevant

  • At Step 3, for the date column, select DMY as the format. You can also select the "Destination" if you want the results written elsewhere.

  • Then "Finish".

enter image description here

That's it. Your dates will be converted in place

Since your dates are now "real" Excel dates, you can use the Cell ► Number Format dialog to change the format to whatever you want.

查看更多
别忘想泡老子
4楼-- · 2019-03-01 10:53

You are making this way too complicated. Just use the DATE(year,month,day) function and switch the DAY() and YEAR() inside it.

If in cell A1 you have a European-style date in this format: 12-04-2017; Excel will interpret this as Dec 4, 2017.

Excel will interpret it properly as Apr 12, 2017 if you change it to the American-style of 04-22-2017 by writing this equation in another cell: "=DATE(YEAR(A1),DAY(A1),MONTH(A1))".
(I put the DAY() in the month spot and the MONTH() in the day spot.) Now you can use any date format you want.

查看更多
乱世女痞
5楼-- · 2019-03-01 10:54

OPTION 1)

Assuming that you source date that is in the number format dd.mm.yyyy stored as an excel date serial and only formatted to display as dd.mm.yyyy then the best fix is to select the cells you want to modify. Go to your home tab, and select the number format and change it to General. See Green circles in image below. IF the format is already set to general, or when you switch it to general your numbers do not change, then it is most likely that your date in dd.mm.yyyy format is actually text. and will needed to be converted as per OPTION 2 below. However, if the number does change when you set it to general, select the arrow in the bottom right corner of the number area (see red circle).

Cell number format location

After clicking the arrow in the red circle you should see a screen similar to the one below:

Custom number format

Select Custom from the category list on the left, and then in the Type bar enter the format you want which is yyyy/mm/dd.

OPTION 2

=date(Right(A1,4),mid(A1,4,2),left(A1,2))

This assumes your original date is a string stored in A1, and converts the string to a date serial in the form excel stores dates in.1 You can copy this formula down beside you dates. You can then apply cell formatting for the date as described above, or use the build short or long date if that style matches your needs.

1Excel counts the number of days since January 0 1900 for the windows version of excel. I believe mac is 1904 or 1905.

查看更多
登录 后发表回答