Forum Discussion
NanaNina
May 15, 2023Copper Contributor
Sorting Within a Single Cell
I am trying to sort text information within a single cell so that the latest entry is at the top as opposed to the bottom. The manual effort would be very time consuming (see example). BEFORE ...
- May 17, 2023
NanaNina note that Patrick2788 works unless you cross over the year because it is text sorting those dates. Here is an option to actually use the date VALUES:
=LET(in, A1, lines, TEXTSPLIT(in,,CHAR(10)), sorted, SORTBY(lines,DATEVALUE(TEXTBEFORE(lines,":")),-1), TEXTJOIN(CHAR(10),,sorted) )
PeterBartholomew1
May 17, 2023Silver Contributor
This requires 365 but then, there are currently no other versions of Excel that I would consider using.
= LET(
dates, DATEVALUE(TEXTBEFORE(information, ":")),
SORTBY(information, dates, -1)
)