Question: I have a query which I get as:

```
var query = Data.Items
            .Where(x => criteria.IsMatch(x))
            .ToList<Item>();

```

This works fine.

However now I want to break up this list into x number of lists, for example 3. Each list will therefore contain 1/3 the amount of elements from query.

Can it be done using LINQ?

Answer: 
I think something like this could work, splitting the list into [`IGrouping`](http://msdn.microsoft.com/en-us/library/bb344977.aspx)s.

```
const int numberOfGroups = 3;

var groups = query
    .Select((item, i) => new { item, i })
    .GroupBy(e => e.i % numberOfGroups);

```
You can use `Skip` and `Take` in a simple `for` to accomplish what you want

```
   var groupSize = (int)Math.Ceiling(query.Count() / 3d);
   var result = new List<List<Item>>();
   for (var j = 0; j < 3; j++)
      result.Add(query.Skip(j * groupSize).Take(groupSize).ToList());

```