Excel – How to convert “29/05/2017 14:52:12” to date format

microsoft-excel-2010

I've been sent a spreadsheet with dates in the format dd/mm/yyyy hh:mm:ss. The date column itself is formatted using the Custom option in the Number tab, and the option selected is dd/mm/yyyy hh:mm so that the entry in the actual cell is 29/05/2017 14:52 with the seconds omitted. This is fine.

I've then pulled my own version of the report spreadsheet directly from the application that generates it, and the date column is formatted as text and displays 29/05/2017 14:52:12 etc. I've tried to duplicate the formatting from the 1st report, selected Custom dd/mm/yyyy hh:mm , but no matter what I do, the column's cells will not convert to dates.

After making the change I've gone back into the Format menu and seen that the selected option is still highlighted, however the cells will not behave like dates – can't filter as dates etc. What am I doing wrong?

Best Answer

After making the change I've gone back into the Format menu and seen that the selected option is still highlighted, however the cells will not behave like dates - can't filter as dates etc.

Excel only knows three types of data: text, number and boolean (true / false)

  • Numbers can be integers and decimals and you can format them to appear as several type of information: numbers with different formattings, currency, date, time ...
  • text is just text, whichever number formatting you try to apply on it Excel will just ignore it as it will apply number formatting to numbers only.

What am I doing wrong?

Instead of trying to solve it with formatting, you need to use another column where you use a formula to convert your data to numbers (formatted as dates).
Have a look on DateValue function.

After converting your text to numbers you can apply your desired date formatting on it.

Related Question