Calculating inside a loop

Hi All,

Am doing a project which requires to calculate number of caregivers in a home(this is a loop).
Based on the number of children under each care givers I will need to do another loop for the children under each caregiver.
Is it possible to have 2 separate loops but the total sum in the 1st loop acts as the control for the 2nd loop and I will also need to pull in the names of the care givers into the 2nd loop so as to know how which child belongs to which caregiver.
After establishing the no of children I will then need to do a 3rd loop with some questions for each child pulling their names(if possible also the caregiver) in the 3rd loop so as to know which child is being referred to.
Unfortunately this is the approach required as opposed to loop with a loop within a loop.

Looking forward to any help I can get.

Regards,

PN