I want to convert dates formatted like "March 30th 2017, 05:00:00.000" to an excel date value? What's the most elegant solution I can do this with using a cell-formula and not VBA?
相关问题
- Excel sunburst chart: Some labels missing
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
- DoCmd.TransferSpreadsheet is not recognizing works
相关文章
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- What's the easiest way to create an Excel tabl
- How to create a hyperlink to a different Excel she
Nested IFERROR functions can handle the variety of number ordinals.
I used a custom number format of
[Color10]mmmm dd, yyyy hh:mm:ss.000;;;[Color3]@
. Beyond the fact that the text is left-aligned and the true dates are right-aligned, this will put text-that-look-like-dates in a red font and true dates in a green font.This will do the standard
"rd","th","st","nd"
You can add other suffixes as you need to the formula
Then you can format it as you like.
If you want a true date and want to drop the time part then:
You will need to nest SUBSTITUTE() functions to handle "nd" and "st" ordinals if you have them: