You could do it as outlined in the image shared below:
In the survey tab of your xlsform:
Data entry screen as seen in Enketo:
Reference xlsform:
Average (if-statement).xlsx (10.1 KB)
You could do it as outlined in the image shared below:
Average (if-statement).xlsx (10.1 KB)