Forum Discussion
Jules0160
Oct 22, 2024Copper Contributor
Sorting Dewey codes in Excel
How do I sort a column where the cells contain both numbers and text eg 398 FOLK, 920 ATT, 942 TUDORS as well as just numbers eg 577, 796.33. I have tried making the cell format text, general and sp...
- Oct 22, 2024
Well, a prior question would have to be "How do you want them sorted?" On the basis of the numeric values; alphabetically, on the basis of the letters; some hybrid of your own design?
What happens now when you sort them by all those different methods you mention? What about each of those is falling short of what you want?
We need to answer these questions--to define the sort you desire--before coming up with the satisfactory method. I realize you probably think the answer is obvious, given the reference to the Dewey (decimal?) code, but not all of us are versed in that coding system, even if we do know a lot about a lot of books.
SergeiBaklan
Oct 23, 2024MVP
I'd suggest to modify a bit
=LET(
i, --TEXTBEFORE(DD," ",,,1),
a, TEXTAFTER(DD," ",,,,""),
SORTBY(DD,i,1,a,1) & ""
)
to fix for the records where we have numbers only.
Jules0160
Oct 23, 2024Copper Contributor
Thank you for spending time helping to sort this!