Sampling with replacement

I am working on sampling, and I have this scenario. I am doing sampling of staff from register, and if a staff is still alive, the tablet must generate additional questions(questions about insurance) and if he/she has died it must hide those questions. since it is a sampling, it must open those additional questions when nth staff reached and it must hide them again when nth+k staff reached. for example I want the tablet to open those questions when the 5th staff in register is reached and it must hide them when the 12th staff is reached. if in the interval from 5th up to 12th there is a staff who has died it must add one staff to replace those who died(replacement if in that interval there is some staff who has died) to the limit(12th) then the 13th staff must replace those who died. because I have a target(number) of staff to respond to those specific questions in that range. in this specific interval more than one staff can be died and I want to automate them so that they can be replaced. so that wen I set a target of any staff to be asked those specific questions, I have to get it.

Hi @Dushime
If you want us to help please share a sample (small ideally) form that shows what you want to achieve. From your description it's not clear. Maybe you can achieve what you need hiding some questions (groups of questions): https://xlsform.org/en/#relevant