Recording the number of runs for iteration

Hi, I am trying to get the number of runs, and identify the element counts in each run. What I am trying to achieve finally is based on the element count on each iteration , the data will be placed on the excel sheet according to the count number as the row number, so that all the data is in one single sheet. Is there a better way to approach this? Thanks all!