How to divide objects in groups

DUPLICATE THREAD: