using System; using System.Linq; using System.Collections.Generic; public class Test { class x { public int QuestionID; } class objx { public int RowNumber; public int DatabaseID; public int SetID; } public static void Main() { var objY = new List() { new x{QuestionID=1}, new x{QuestionID=2}, new x{QuestionID=3}, new x{QuestionID=4}, new x{QuestionID=5}, new x{QuestionID=6}, new x{QuestionID=7}, new x{QuestionID=8}, new x{QuestionID=9}, new x{QuestionID=1}, new x{QuestionID=2}, new x{QuestionID=3}, new x{QuestionID=4}, new x{QuestionID=5}, new x{QuestionID=6}, new x{QuestionID=7}, new x{QuestionID=8}, new x{QuestionID=9}, new x{QuestionID=1}, new x{QuestionID=2}, new x{QuestionID=3}, new x{QuestionID=4}, new x{QuestionID=5}, new x{QuestionID=6}, new x{QuestionID=7}, new x{QuestionID=8}, new x{QuestionID=9} }; var objX = objY.Select((x, i) => new { ObjX = x, Index = i }) .GroupBy(x => x.Index / 5) .Select((g, i) => g.Select(x => new objx { RowNumber = x.Index + 1, DatabaseID = x.ObjX.QuestionID, SetID = i + 1 }).ToList()) .ToList(); foreach(var xList in objX) Console.WriteLine("Count: " + xList.Count); } }