"
the data is already sorted or indexed" seems similar to what I have read in the Help for certain of the functions, that they are really fast when handling sorted data. I have a couple of questions:
1. I don't understand exactly what I need to do to bring this about. Apart from the obvious that is, which is to click on the AZ|v button (my depiction of the graphic) for the column or columns before running a formula with the function(s) on that column or columns.
But:
Do I need to signal to the function that the data is sorted? - i.e. set a parameter 'this data is sorted'?
For FastExcel, or for that matter a built-in function that runs fastest on sorted data, to know that the data is sorted - does it not have to scan the data to determine that it is sorted? Is that not slow? Does it only achieve a speed-up the next time it runs?
What if I go into the sorted row and change one value, breaking the 'sortedness' of the data?
What if I sort in descending order, Z-A?
"
sorted or indexed" - what is the difference in Excel? This is not Access or SQL Server, where indexes are things that you define/create and then they update automatically. How do I index in Excel? That is one of the things I most hate about Excel - it doesn't seem to have the concept of a primary key, even if lookup/match formula columns seem quite like foreign keys. I used to try to use the Scripting dictionary to 'bolt on' this key functionality but I don't bother any more, as it requires too much work to transfer the data to/from Excel. An Excel table provides uniqueness of columns, but that is not uniqueness of rows, or anything like a multi-column primary key.
2. "The problem with using GT LT etc operators is that they force a linear scan of the data which is very slow unless the data is already sorted or indexed."
Fair point, but I suggest it could still be worth it, at least for the case of sorted data. After all there are many functions that run fast on sorted data and slow on unsorted data. But we still value them for their richer functionality than if built more simply.
cheers