Given the way your data appears, I will make the following assumptions.
- The data originally came from a CSV file with the date formatted as "D/M/YYYY H:MM:SS AM/PM"
- Your "Windows Regional Short Date Settings" are "MDY"
- Your cell format in column C of your Excel file is "yyyy/mm/dd hh:mm:ss am/pm"
If all that is true, you have two problems
- The dates that you see as text need to be converted to "real" dates.
- The dates that you see as dates were likely converted incorrectly with the month and day having been interchanged from what they were originally intended.
To fix both problems, you need to
- Determine if the value to be converted is a date or a text string
- You can use ISNUMBER for that since dates are stored as numbers
- If it is a date
- Reverse the month and day parameters
- If it is a text string
- Use text functions to parse out the relevant values
- I recommend using the DATE function as there is no ambiguity or issues with windows regional settings to muck things up.
=IF(ISNUMBER(C1),
DATE(YEAR(C1),DAY(C1),MONTH(C1))+TIME(HOUR(C1),MINUTE(C1),SECOND(C1)),
DATE(MID(C1,FIND("/",C1,FIND("/",C1)+1)+1,4),MID(C1, FIND("/",C1)+1, FIND("/",C1,FIND("/",C1)+1)-FIND("/",C1)-1),LEFT(C1,FIND("/",C1)-1)) +
TIMEVALUE(MID(C1,FIND(" ",C1)+1,12)))
Then it is just a matter of formatting to return either a date or a number.