c.1380, from O.Fr. sorte "class, kind," from L. sortem (nom. sors) "lot, fate, share, portion, rank, category," from PIE base *ser- "to line up" (cf. L. serere "to arrange, attach, join;" see series). The sense evolution in V.L. is from "what is allotted to one by fate," to "fortune, condition," to "rank, class, order." Out of sorts "not in usual good condition" is attested from 1621, with lit. sense of "out of stock."
1358, "to arrange according to type or quality," from O.Fr. sortir "allot, sort, assort," from L. sortiri "draw lots, divide, choose," from sors (see sort (n.)). In some senses, the verb is a shortened form of assort.