Why bother, SMALL does the job. UDFs are usually slower than formulas.
Thanks....but actually, it goes on with another IF-THEN formulas, which is actually a bit "hard" to explain. But anyways, here it is:
Alloc1 Start 1 End 1 Alloc2 Start 2 End 2 Alloc3 Start 3 End 3
Employee 1 (Sheet1) 5 1:00 x 7 x x
Employee 2 (Sheet2) 4 2:00 x
Employee 3 (Sheet3) 8 1:00 x 5 5:00 x . .
**END TIME is based on the particular time the last case for that "batch" is done. (ex. Employee 1's 7th case was done at 5:06)
**START TIME is provided, BUT, if the END TIME from previous "allocations" is greater, the END TIME will be used as the START TIME (ex. Employee 3's START TIME)
I was able to do it with a simple IF-THEN command, yet, it can only be done only up to 4 alloc (or allocations), beyond that, I already get an error (something about too many arguments, etc). I'm not familiar that with procedures (or functions), so, I was hoping someone will be able to help me translate it into procedures (or functions).