I have a sequence of numbers in an Excel worksheet, and I'd like to find the longest subsequence that matches some criteria. For example, say I have the following:
and I'd like to know where the longest subsequence with every value less than 10 starts and how long it is (row 7, 3 long) or greater than equal to 10 (row 4, 3 long), etc.
I can easily generate an array or vector of TRUEs and FALSEs corresponding to the values and whether they meet the criteria I want, but I have no idea even where to start to find and count subsequences.
I'd prefer not to have a VBA solution, simply because I don't really know VBA and if I have to maintain a script, I'll just whip something up in perl that reads the clipboard and writes the result I want back to it.