Assuming that you want to get the results in sheet 2, not sheet 1, then perhaps the following will help.
1) Populate column C in sheet 1 by placing zero in C1 then use the following for C2 and down: =SUM(B$2:B2)
2) Populate the numbers in sheet 2 by placing a one in the first row then using the following for the second row and down:
Formula:
=IFERROR(IF(E1+1<=Sheet1!F$1,E1+1,""),"")
3) Populate the names in sheet 2 using:
Formula:
=IF(E1="","",INDEX(Sheet1!A$2:A$5,IF(ISNUMBER(MATCH(E1,Sheet1!C$2:C$5,0)),MATCH(E1,Sheet1!C$2:C$5,0),MATCH(E1,Sheet1!C$1:C$5,1))))
Let us know if you have any questions.
Bookmarks