Hi everyone.
I am trying to convert a long list of dates from text to date (see A) so that I can sort them from newest to oldest. I've tried converting them using differnt formulas (see B:C) but these don't work.
Any suggestions?
Hi everyone.
I am trying to convert a long list of dates from text to date (see A) so that I can sort them from newest to oldest. I've tried converting them using differnt formulas (see B:C) but these don't work.
Any suggestions?
try =TEXT(A2, "mmm-dd-yyyy")
http://www.easyexcelanswers.com
try this in D2, then copy and paste down
You can miss out the TEXT(value,"mm/dd/yyyy") if you just want to format the column to your required date formate![]()
Please Login or Register to view this content.
The other part of the formula does..........
When the string length is 20, this means the day value is only 1 number, like 3rd, 4th, 5th
When the string length is 21, this means the day value has 2 numbers, like 23rd, 24th, 25th
Once it's established this, it takes each element of the string value using MID to put the right values into the DATEVALUE formula
Hi,
Can't do better than this, I'm afraid:
=0+SUBSTITUTE(TRIM(SUBSTITUTE(REPLACE(A2,1,3,MATCH(LEFT(A2,3),INDEX(TEXT(30*ROW($1:$12),"mmm"),,),0)),"00:00:00",""))," ","/")
Must be much better (and shorter) solutions, though.
Regards
oh, btw, this presumes all new date values you'll be working with will always presented in exactly the same format, if you are aware there might be variations let us know and we'll put additional tests into the formula
Thanks easyexcelanswers but I still can't sort from oldest to newest. It will only allow sorting from A-Z which prevents me from using the data.
Sorry, I made a mistake by using the TEXT in the formula, you need to take that out of the formula
Then format the column to the correct date format you want![]()
Please Login or Register to view this content.
It will then allow sorting as expected
...and another offering
Formula:
Please Login or Register to view this content.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
Thanks for the help everyone.
I used XOR LX's formula because I needed to make some adjustments and that made the most sense to me.
But I really appreciate all the other responses.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks