Calculate in odk

Hi

Anyone could help on

How could we express this line in xlsform "if(count(instance('chart')/zscore/gender[@id=/data/child_gender]/length[@id = /data/child_height]/weight[@low <= /data/child_weight][@high = 'none' or @high > /data/child_weight]) = 1, instance('chart')/zscore/gender[@id=/data/child_gender]/length[@id = /data/child_height]/weight[@low <= /data/child_weight][@high = 'none' or @high > /data/child_weight], 'invalid entry')" />"

I have copied this line from Commcare "WHO standard Table"

thank you

with regards

aman