Same as byX, but with more flexible group size, to avoid that the last group has only a few entries (<50% of desired size).
byX
Useful links