3 added 145 characters in body edited Jun 11 '14 at 13:23 PlaysDice 69955 silver badges1111 bronze badges Transpose and Count might be your friend SeedRandom[125]; data = Sort@RandomChoice[{1, 2}, {10, 2}] counted = Count[data, #] & /@ data Transpose@Append[Transpose@data, counted]  with sample data {{1, 1}, {1, 1}, {1, 2}, {1, 2}, {1, 2}, {2, 1}, {2, 1}, {2, 2}, {2, 2}, {2, 2}}  output is (TableForm'd for clarity) 1 1 2 1 1 2 1 2 3 1 2 3 1 2 3 2 1 2 2 1 2 2 2 3 2 2 3 2 2 3  EDIT Timing-wise, this starts to get increasingly sluggish at ~4,000 records, so the approaches that use ..Array or Dispatch may be preferable. Transpose and Count might be your friend SeedRandom[125]; data = Sort@RandomChoice[{1, 2}, {10, 2}] counted = Count[data, #] & /@ data Transpose@Append[Transpose@data, counted]  with sample data {{1, 1}, {1, 1}, {1, 2}, {1, 2}, {1, 2}, {2, 1}, {2, 1}, {2, 2}, {2, 2}, {2, 2}}  output is (TableForm'd for clarity) 1 1 2 1 1 2 1 2 3 1 2 3 1 2 3 2 1 2 2 1 2 2 2 3 2 2 3 2 2 3  Transpose and Count might be your friend SeedRandom[125]; data = Sort@RandomChoice[{1, 2}, {10, 2}] counted = Count[data, #] & /@ data Transpose@Append[Transpose@data, counted]  with sample data {{1, 1}, {1, 1}, {1, 2}, {1, 2}, {1, 2}, {2, 1}, {2, 1}, {2, 2}, {2, 2}, {2, 2}}  output is (TableForm'd for clarity) 1 1 2 1 1 2 1 2 3 1 2 3 1 2 3 2 1 2 2 1 2 2 2 3 2 2 3 2 2 3  EDIT Timing-wise, this starts to get increasingly sluggish at ~4,000 records, so the approaches that use ..Array or Dispatch may be preferable. 2 added 27 characters in body edited Jun 10 '14 at 19:19 PlaysDice 69955 silver badges1111 bronze badges Transpose and Count might be your friend SeedRandom[125]; data = Sort@RandomChoice[{1, 2}, {10, 2}] counted = Count[data, #] & /@ data Transpose@Append[Transpose@data, counted]  with sample data {{1, 1}, {1, 1}, {1, 2}, {1, 2}, {1, 2}, {2, 1}, {2, 1}, {2, 2}, {2, 2}, {2, 2}}  output is 1 1 2 1 1 2 1 2 3 1 2 3 1 2 3 2 1 2 2 1 2 2 2 3 2 2 3 (TableForm'd for clarity) 2 2 31 1 2 1 1 2 1 2 3 1 2 3 1 2 3 2 1 2 2 1 2 2 2 3 2 2 3 2 2 3  Transpose and Count might be your friend SeedRandom[125]; data = Sort@RandomChoice[{1, 2}, {10, 2}] counted = Count[data, #] & /@ data Transpose@Append[Transpose@data, counted]  with sample data {{1, 1}, {1, 1}, {1, 2}, {1, 2}, {1, 2}, {2, 1}, {2, 1}, {2, 2}, {2, 2}, {2, 2}}  output is 1 1 2 1 1 2 1 2 3 1 2 3 1 2 3 2 1 2 2 1 2 2 2 3 2 2 3 2 2 3 Transpose and Count might be your friend SeedRandom[125]; data = Sort@RandomChoice[{1, 2}, {10, 2}] counted = Count[data, #] & /@ data Transpose@Append[Transpose@data, counted]  with sample data {{1, 1}, {1, 1}, {1, 2}, {1, 2}, {1, 2}, {2, 1}, {2, 1}, {2, 2}, {2, 2}, {2, 2}}  output is (TableForm'd for clarity) 1 1 2 1 1 2 1 2 3 1 2 3 1 2 3 2 1 2 2 1 2 2 2 3 2 2 3 2 2 3  1 answered Jun 10 '14 at 19:14 PlaysDice 69955 silver badges1111 bronze badges Transpose and Count might be your friend SeedRandom[125]; data = Sort@RandomChoice[{1, 2}, {10, 2}] counted = Count[data, #] & /@ data Transpose@Append[Transpose@data, counted]  with sample data {{1, 1}, {1, 1}, {1, 2}, {1, 2}, {1, 2}, {2, 1}, {2, 1}, {2, 2}, {2, 2}, {2, 2}}  output is 1 1 2 1 1 2 1 2 3 1 2 3 1 2 3 2 1 2 2 1 2 2 2 3 2 2 3 2 2 3