This guide will walk you through creating a BMI (Body Mass Index) calculator using variables and logic in your form.
You can use variables to store user input (weight and height), calculate the BMI value, and dynamically display different messages based on the result.
🧩 For a ready-made solution, you can use this BMI Calculator template to easily set up BMI calculation and customize it for your needs.
Step 1: Create fields for weight and height
The BMI formula is weight / height², and we'll start by gathering the required data from the respondent for calculating their BMI:
Add a number field for weight with the ID
weight
.Add another number field for height with the ID
height
.
Step 2: Create a variable to calculate height²
In the Variables section, click +Add to create a new Formula variable.
Name it Height², and assign an ID
height2
to itIn the default formula field, add the formula to calculate height² – refer to the height value by the Height field ID:
height * height
Set the maximum number of decimal places to 2
Step 3: Create a variable to calculate BMI
In the Variables section, click +Add to create another Formula variable.
Name it BMI value, and assign an ID
bmivalue
to itIn the default formula field, add the formula to calculate the BMI value, dividing the weight field value by the height² variable value:
weight / height2
Set the maximum number of decimal places to 2
☝️ Parentheses are not supported in the formula variables.
When setting up formulas, avoid using (). For complex calculations, follow a step-by-step approach by creating separate variables for each part of the calculation:
Height squared:
height2 = height * height
BMI:
bmivalue = weight / height2
This setup ensures that the bmivalue
is dynamically calculated based on the user's input for height and weight.
Step 4: Create personalized ending pages for each result
Create separate ending pages for each possible result (e.g., Underweight, Normal weight, Overweight, Obese). Use these pages to display the results and suggest tailored recommendations.
💡 Use answer-piping to display the calculated BMI value to the respondent on the ending page or in form fields' titles/descriptions.
In the message on each ending page, insert @bmivalue
– this will dynamically display the user’s calculated BMI value in any message:
"Your BMI is @bmivalue"
To add an ending page, click +Add ending in the bottom left Ending pages section:
💡 We recommend keeping the default ending page (first one on the list) and customizing it to serve as a 'fallback' page for any edge cases.
For example, if there are any discrepancies in logic, or if two variables end up getting the same amount of points (so there's no way to pick the winner based on the highest score) – the user will land on that default ending page.
Once your fallback page is ready, add personalized ending pages for each result. Customize the content using text, media, formatting, and whatever else suits your quiz. Name each ending page to easily tell one from the other in Logic:
Step 5: Set up logic to show a relevant ending page
From the form settings, jump to Advanced logic:
In the On Submit section, add the conditions to determine when each ending page should be displayed.
Add conditions based on the calculated BMI value ranges to redirect users to the appropriate ending page:
If BMI is less than 18.5, redirect to the Underweight ending page.
If BMI is between 18.5 and 25, redirect to the Normal weight ending page.
If BMI is between 25 and 30, redirect to the Overweight ending page.
If BMI is greater than 30, redirect to the Obese ending page.
💡 For more information on setting up multiple ending pages with logic to redirect users based on their responses, check out our article on how to add multiple ending pages with redirect logic
Step 6: Test the BMI calculator
Before sharing your calculator, it’s important to test it thoroughly and make sure the logic, calculations, and redirections are working as expected. Here’s what you can do:
Preview how the form and its fields look in the public view
Run multiple test submissions with different values to see if the BMI value is calculated correctly, and the appropriate ending page shows up
Make adjustments to variables' settings or logic, if needed
Step 7: Share your BMI calculator with the audience
Once everything looks good, go to the Share → Publish tab, and copy your quiz's public link to share with your audience, or grab the embed code to embed it on your website:
🎨 Want to give your quiz a fully branded experience?
Learn how to set up a custom domain for your quiz
📮 Want to send tailored follow-ups to each respondent?
Check out how to set up conditional emails for respondents