Calculation in xlsform

please me build calculation of calculating BMI in xlsform
BMI = [weight(Kg)] x [height (m)]2
Thanks

Hi @Health_screening_19
first of all welcome to the forum! Please introduce yourself here!

I'm sure you can do that on your own, you need just:
two decimal questions (read more about question types here https://xlsform.org/en/#question-types) for weight and height
then
calculate which in its calculation column will have ${weight}*${height} div 2 (here you can read more about operators https://docs.opendatakit.org/form-operators-functions/#math-operators)
and that's all. Then you can display such a result or add as a value to another question.

bmi.xlsx (8.7 KB)

Actually, BMI = kg/m2, so this should be:

${weight} div (${height} * ${height})

[lest folks mistakenly think 'div' is the square operator, of which there is none of XPath...]

1 Like