Forum Discussion
GetAKitty4465
Oct 29, 2019Copper Contributor
Need Help Sorting This Date/Time Column
I have 8000 text messages that have been imported into Excel. Column A has the date/time and Column B has the text itself. The format of A is: Monday, November 19, 2018 8:43:07 AM Monday, Nove...
mathetes
Oct 29, 2019Gold Contributor
GetAKitty4465 I'm attaching a spreadsheet that contains three formulas. I didn't test it against your whole sample list, so it's possible it might encounter a glitch or two with dates of signficantly different lengths, but here's how this works.
- Column A contains the text values like you have them.
- Column B finds the first comma in that text, and adds 2, which is ALWAYS going to be the first letter of the month
- Column C finds the second comma in the text, and adds 6, which will ALWAYS be the end of the year
- Column D, then, uses those two numbers to find the text that begins with number in col B, ends with ColC minus ColB (this last subtraction calculates the length of the date string)
- Column E converts that to Excel's date value
- Column F simply is a more elaborate formula which does the work of columns D and E in one step
The second row just shows, in cell F3, that you can format the cell to read as a "user friendly date", but the value remains a sortable date value.
Once you've copied these formulas all the way down your 8000 rows, you'll be able to sort based on actual date value.