I think the issue is that you are trying to reference a variable ${s1p5} which is in a repeat group.
As you reference it from outside that group, you need to specify which iterations should be considered.
One approach is to interview one respondent at the time (instead of doing it by section). This way you would have a single repeat for the whole questionnaire.
The other approach is to check the age of each respondent. You can do it by inverting the order of group and repeat of seccao2 and using the position(..) variable to cycle with indexed-repeat through the age of respondents. Please see sample file attached censo_af_form_ine_grpoc_1709_ix_am.xlsx (116.2 KB) .
I hope this helps!
Best,
Andrea