I have a need to loop through a dynamic range with a formula preferrable. If i have to use a macro i can, but would rather not if possible just for ease of maintenance down the road.
My situation is this:
"Names" would have a list of names repeated a number of times (variable but is based on the number of items in "Numbers" and can be obtained with a count. I've done this with no problem already using =INDEX(Names!$B$2:$B$400,INT((ROWS($A$7:A11)-1)/COUNTIF(Final$C$2:$C$1000,11000)+1)). The number of items in "Numbers" can vary but if it changes in count the number of repetitions of names in "Names" column also has to change (in this example im using 3 random numbers which means each person is replicated 3 times). So in essence all items in "Numbers" needs to be repeated for all of the names in "Names" and both need to be variable from time to time as other things in the workbook change. I've looked through various forumns with no luck on how to replicate "numbers" for the items in "Names". Any help would be much appreciated.
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]Names[/TD]
[TD="align: center"]Numbers[/TD]
[TD="align: center"][/TD]
[TD="align: center"]Names[/TD]
[TD="align: center"]Numbers[/TD]
[/TR]
[TR]
[TD]Bobby
[/TD]
[TD]Random1[/TD]
[TD][/TD]
[TD]Bobby[/TD]
[TD]Random1
[/TD]
[/TR]
[TR]
[TD]Jill[/TD]
[TD]Random2[/TD]
[TD][/TD]
[TD]Bobby[/TD]
[TD]Random2[/TD]
[/TR]
[TR]
[TD]Randy[/TD]
[TD]Random3[/TD]
[TD][/TD]
[TD]Bobby[/TD]
[TD]Random3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jill[/TD]
[TD]Random1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jill[/TD]
[TD]Random2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jill[/TD]
[TD]Random3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Randy[/TD]
[TD]Random1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Randy[/TD]
[TD]Random2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Randy[/TD]
[TD]Random3[/TD]
[/TR]
</tbody>[/TABLE]
My situation is this:
"Names" would have a list of names repeated a number of times (variable but is based on the number of items in "Numbers" and can be obtained with a count. I've done this with no problem already using =INDEX(Names!$B$2:$B$400,INT((ROWS($A$7:A11)-1)/COUNTIF(Final$C$2:$C$1000,11000)+1)). The number of items in "Numbers" can vary but if it changes in count the number of repetitions of names in "Names" column also has to change (in this example im using 3 random numbers which means each person is replicated 3 times). So in essence all items in "Numbers" needs to be repeated for all of the names in "Names" and both need to be variable from time to time as other things in the workbook change. I've looked through various forumns with no luck on how to replicate "numbers" for the items in "Names". Any help would be much appreciated.
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]Names[/TD]
[TD="align: center"]Numbers[/TD]
[TD="align: center"][/TD]
[TD="align: center"]Names[/TD]
[TD="align: center"]Numbers[/TD]
[/TR]
[TR]
[TD]Bobby
[/TD]
[TD]Random1[/TD]
[TD][/TD]
[TD]Bobby[/TD]
[TD]Random1
[/TD]
[/TR]
[TR]
[TD]Jill[/TD]
[TD]Random2[/TD]
[TD][/TD]
[TD]Bobby[/TD]
[TD]Random2[/TD]
[/TR]
[TR]
[TD]Randy[/TD]
[TD]Random3[/TD]
[TD][/TD]
[TD]Bobby[/TD]
[TD]Random3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jill[/TD]
[TD]Random1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jill[/TD]
[TD]Random2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jill[/TD]
[TD]Random3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Randy[/TD]
[TD]Random1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Randy[/TD]
[TD]Random2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Randy[/TD]
[TD]Random3[/TD]
[/TR]
</tbody>[/TABLE]