Fixed line number calculation for each cell