• Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
  • Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
home/Knowledge Base/Advanced Techniques/How to create Calculation Forms (BMI Calculator with Math Formulas)
Popular Search:Getting Started

How to create Calculation Forms (BMI Calculator with Math Formulas)

1314 views 4 June 1, 2020 admin

You can use Easy Forms to build forms with powerful calculations and advanced mathematics. Use it to create online calculators, calculate costs and discounts, monthly instalment calculators and much more.

Apply Math Formulas with Conditional Logic

To make our application more robust and flexible, we have introduced this feature within our Rule Builder. So, you will be able to apply different formulas according to the user behavior or predefined values, and use the result as input for other conditional rules. It’s very powerful.

To show you an example, we are going to create an online calculator, something simple to introduce Math Formulas and see how it can interact with other tools inside the rule builder.

How to create a Body Mass Index Calculator (BMI Calculator)

According to the CDC, to calculate the body mass index we can use the metric system, the formula for BMI is weight in kilograms divided by height in meters squared. Since height is commonly measured in centimeters, an alternate calculation formula, dividing the weight in kilograms by the height in centimeters squared, and then multiplying the result by 10,000, can be used.

  • Formula: weight (kg) / [height (m)]2
  • Calculation: [weight (kg) / height (cm) / height (cm)] x 10,000

Ok, let’s do it.

1. To start, go to the Form Builder and add four fields:

  • 3 number fields: Your Weight (kg), Your Height (kg) and Your BMI
  • 1 text field: With the label: This Means

We are going to add a descriptive title, a few tweaks and some text to inform our users about BMI.

Check it out.

2. Now, go to the Rule Builder (Click Forms -> Actions -> Conditional Rules) and add your first rule:

If “Your Weight (kg)” is greater than 10
And “Your Height (cm)” is greater than 100
Then Evaluate Formula {{number_1}} / {{number_2}} / {{number_2}} * 10000 and set the result to Field Your BMI

Tip! You don’t need to remember the ID of each Field, just enter a curly bracket “{” and a auto-suggest tool will show all the form fields.

Building a BMI Calculator - Conditional Rules

And that’s it.

Now your form should look like this:

Ok! It works!

But, it’s no so friendly to our users. We need to use simple words to communicate the status.

Display dynamic text with conditional rules: “Format Text” action

As we already know the user’s BMI, what we need is to display a message that tells him, in simple words, what the index means.

For that, we are going to add 4 conditional rules, each one to cover the 4 BMI Categories and 4 different messages. Since these rules depend on the value calculated by the formula, we must add them after the first rule. Remember, order is important in conditional logic.

Tip: Take into consideration we have disabled opposite actions, because we are covering all the possible values of the BMI field, that means that one of these actions always will be executed, excluding the others.

First category: BMI is less than 18.5

Building a BMI Calculator: Format Text

Second category: BMI is between 18.5 and 24.9

Building a BMI Calculator: Format Text

Third category: BMI is between 25 and 29.9

Building a BMI Calculator: Format Text

Fourth category: BMI is equal or greater than 30

Building a BMI Calculator: Format Text

And that’s all!

Now your form should look like this:

Calculate Your Body Mass Index II

In this tutorial we saw:

  1. How to evaluate math formulas (form calculations).
  2. How to use the suggestion tool to select fields
  3. How to use the result of a mathematical formula as the input value for other conditions (order is important)
  4. How to use the “Format Text” tool to display dynamic text on your form.

Was this helpful?

4 Yes  1 No
Related Articles
  • Compare Date fields: How to ensure that Finish Date is at least equal to *or after* Start Date, and *not* before?
  • How to embed a Form using iFrame code
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
  • Date Formats with Dynamic Content

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

You must be logged in to post a comment.

Advanced Techniques
  • How to create Calculation Forms (BMI Calculator with Math Formulas)
  • Compare Date fields: How to ensure that Finish Date is at least equal to *or after* Start Date, and *not* before?
  • How to embed a Form using iFrame code
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
View All 21  
Popular Articles
  • How to Show/Hide HTML elements with Conditional Rules
  • How to enable / disable DEBUG mode
  • How to Submit a Form as WhatsApp Message
  • How to update Form Stats from the command line
  • How to compare two fields to pass the validation (jQuery Validation)
KB Categories
  • Add-Ons
  • Advanced Techniques
  • Common Issues & Troubleshooting
  • Developers "How To's"
  • Getting Started
  • How To

  How to Display Radio Buttons as Buttons

How to create a Terms and Conditions field  

About Easy Forms

With Easy Forms you can create unlimited web forms and most importantly the complete management of them without paying monthly fees

Resources
  • Knowledge Base
  • Documentation
  • Pre-sales Questions
  • Blog
Useful Help Links
  • Get Easy Forms
  • Live Demo
  • License Terms
  • Contact Us
Frequent Visit Links
  • Pre-Sales Questions
  • System Requirements
  • Installing Easy Forms
  • Upgrading Easy Forms
  • Privacy Policy
  • © 2015 - 2024 Baluart EIRL. All Rights Reserved.

Popular Search:Getting Started