Lupp wrote: ↑Mon Sep 09, 2024 11:57 pm
The central shortcoming of RANK() is (imo) that it only works with numbers
Possibly this behavior is due to the StarOffice developers replicating the behavior of RANK in Excel. I see that LibreOffice also offers RANK.AVG and RANK.EQ, neither of which:
• is part of the ODF 1.3 standard,
• can be used with text,
• helps with
ordinal ranking which, based on forum topics, is what many people want.
Tests show that RANK and RANK.EQ are equivalent, though the documentation which I find doesn't say that they are. It is strange to introduce a new RANK.EQ function that seems identical to RANK and not explain how (or if) it is different.
Lupp wrote: ↑Mon Sep 09, 2024 11:57 pm
Sorting by formulas is a doubtable idea anyway
Yes, I don't think I use that in my own spreadsheets. But many people create topics asking for that, so I wrote for them the tutorial referenced earlier. I realize that many people cannot understand how to use formulas in this way. That is their problem, not mine. LibreOffice introduced a feeble SORT function, but it only accepts one key! Later, SORTBY attempts to extend the feature, though it looses the ability to sort columns instead of rows. Neither is part of the ODF 1.3 standard. Neither provides the
sorting permutation which access the data in sorted order unless one creates another range for SORTBY with 1 to N (for INDEX) or 0 to N-1 (for OFFSET) . It seems to me that the LO developers make lots of new features (bloat) without understanding what people really want. The documentation that I can find for SORT and SORTBY doesn't say whether they accept keys which are text, and the examples provided only show using numbers. I installed LO 7.5 a couple of months ago but the sorting functions aren't available there. I'm not going to install LO 24.8 just to test.
Lupp wrote: ↑Mon Sep 09, 2024 11:57 pm
Concerning the sorting I would also prefer a solution creating a (the) sorting permutation using SUMPRODUCT() probably together with OFFSET(), but most users wouldn't understand that.
My
Sorting and Filtering tutorial explains how to do it. And I have found that many people cannot understand it.
Lupp wrote: ↑Mon Sep 09, 2024 11:57 pm
I just used up some time with developing and testing a little package of user code allowing to circumvent the problem. are you interested?
Of course. I have considering doing that too: writing a function which would accept both numbers and text, then return the sorting permutation. I already have
merge sort implemented in Basic and minor changes would make it callable as a Calc function. It
does return the sorting permutation. I understand how to use merge sort to handle multiple keys. A function written in Basic might be a bit slow when sorting 50000 rows by multiple keys, but that should be fine for the more typical case where people have a few dozen rows to sort. You could consider making a
Request for comments topic about your package to get feedback, then creating a tutorial which you can link for people who create topics where that would be an easier solution for them than SUMPRODUCT.