Formula

995
12
Jump to solution
07-18-2022 10:53 AM
DrJumaKhudonazarov
Occasional Contributor II

I need to put a formula on survey 123 to calculate BMI (Body Mass Index). Can someone help me please with how to do that?

4 Solutions

Accepted Solutions
Katie_Clark
MVP Regular Contributor

Well, the formula for BMI is BMI = kg/m2 so you'll need a question for weight (in kg) and height (in meters). Then you just reference those fields in the calculation column of the XLS form (if you're using Survey123 Connect). Are you using connect, or the web form?

The calculation would look something like this:

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

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek

View solution in original post

DrJumaKhudonazarov
Occasional Contributor II

Thank you very much it worked! Really appreciate 

View solution in original post

0 Kudos
Katie_Clark
MVP Regular Contributor

Ah ok. In this case, I would set up individual "note" type questions that will display conditionally based on the answer selected in the measurement question. You can use HTML formatting in the "Label" column of the XLS form. See example below:

Katherine_Clark_0-1672173272561.png

 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek

View solution in original post

DrJumaKhudonazarov
Occasional Contributor II

As always  thank you so much  it works !  

View solution in original post

0 Kudos
12 Replies
Katie_Clark
MVP Regular Contributor

Well, the formula for BMI is BMI = kg/m2 so you'll need a question for weight (in kg) and height (in meters). Then you just reference those fields in the calculation column of the XLS form (if you're using Survey123 Connect). Are you using connect, or the web form?

The calculation would look something like this:

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

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
DrJumaKhudonazarov
Occasional Contributor II

Hi Katherine. thanks. Very helpful advice. I am using connect. I will try  to use  the formula 

0 Kudos
DrJumaKhudonazarov
Occasional Contributor II

DrJumaKhudonazarov_0-1658277415988.png

Hello  I think I am  doing something wrong  I used the formula and didn't  get the calculation . Can you please help?

0 Kudos
Katie_Clark
MVP Regular Contributor

It looks like you entered the calculation under the "Hint" column in the XLS form. You need to have a separate field (row in the XLS form) that will return the value of the calculation (the BMI). For this row, you enter the calculation expression in the "Calculation" column of the XLS form. 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
DrJumaKhudonazarov
Occasional Contributor II

Thank you very much it worked! Really appreciate 

0 Kudos
DrJumaKhudonazarov
Occasional Contributor II

Dear Katherine, that's for your help last time    I have another problem for some reason in one of the multiply questions the survey automatically pick up all questions through I want only 1. Thanks in advance

0 Kudos
Katie_Clark
MVP Regular Contributor

I'm happy to help, but can you provide a bit more detail? Maybe some screenshots of the XLS form or something? 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
DrJumaKhudonazarov
Occasional Contributor II

Dear Katherine  if you have time can you please advise. I have  3 variables  <80cm low risk for CVD:  81-102cm medium risk for CVD and > 103 high risk for CVD.  I want to have risk matrix graph where  I want to see only risk , low, medium  and high . is there any formula  or colour similiar  to  traffic light I can use

0 Kudos
Katie_Clark
MVP Regular Contributor

I'd love to help, but I'm really not quite sure what you're asking...

Are you asking about how to format the color of the text? Or something else?

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek