I’m looking to create a TDEE Calculator where the clients give me their age, height (in inches), weight (lbs), and activity level (the 5 different options then would = a number assigned for calculation).
This would save me a ton of time for my clients vs having to do it manually. I have seen @amy.carlson’s BMI calculator from a year ago and tried to use that as reference, but after trying this now multiple times unsuccessfully, I wanted to reach out here to see if anyone could help!
Appreciate your time and any feedback,
Jace
Best answer by john.desborough
@jacef - i did three different variations of the form as follows and got the same output at 2 decimal level - it seems that it won’t go beyond that at this time in the form.. approaches and comments:
this version rounded the input variables for the activity level multiplier up to two digits ie 1.375 became 1.38 when i tried to enter the 3 digits into multiplier field (see image
this version i initially multiplied the activity variables by 1000 to start with so that they were not three decimal places long, and then divided the results by 1000 to see if it would not end up with result at two decimals (see image)
in this version, i tried to create variables for the 5 activity levels at the 3 decimal points in the value but it rounds them up to 2 digit..
the only way around the two activity multipliers that i can think of is to calculate along the lines as follows (using 1.375 as example)
multiply bmr by 1.37 and add result to v_LA
multiply bmr by 1.38 and add result to v_LA
divide v_LA by 2 to get the average
however, i believe the output will still be limited to two decimal points which may end up with the same rolled up .. and i have run out of time to test that today.. i will leave you to think it through..
have a look at these three samples and tell me if i got it in the ballpark - understanding there will be a rounding error .. i can walk you through the logic in screen shots if that is where you are heading
Idk exactly what you mean by the logic.. if you mean what I tried or how it would need to be calculated. To calculate for TDEE (total daily energy expenditure I would need to ask the following questions for the following equation.
First I’ll need to find BMR (basil metabolic rate),
The equations for males and females are:
Men: (10 × weight in kg) + (6.25 × height in cm) - (5 × age in years) + 5.
Women: (10 × weight in kg) + (6.25 × height in cm) - (5 × age in years) - 161.
Then I will need to take this outcome and multiply it by a score that’s associated with their activity level (see below). So there will be a multiple choice question with the following answers and scores:
To calculate approximate TDEE, simply multiply these activity factors by your BMR:
Sedentary (little to no exercise + work a desk job) = 1.2
Lightly Active (light exercise 1-3 days / week) = 1.375
Moderately Active (moderate exercise 3-5 days / week) = 1.55
Very Active (heavy exercise 6-7 days / week) = 1.725
Extremely Active (very heavy exercise, hard labor job, training 2x / day) = 1.9
@jacef - that is perfect in terms of being able to take a stab to show how it ‘should’ work. I am tied up in a call for the next 2 hours but will try to put something together to show you how i would approach it ..
@jacef - i did three different variations of the form as follows and got the same output at 2 decimal level - it seems that it won’t go beyond that at this time in the form.. approaches and comments:
this version rounded the input variables for the activity level multiplier up to two digits ie 1.375 became 1.38 when i tried to enter the 3 digits into multiplier field (see image
this version i initially multiplied the activity variables by 1000 to start with so that they were not three decimal places long, and then divided the results by 1000 to see if it would not end up with result at two decimals (see image)
in this version, i tried to create variables for the 5 activity levels at the 3 decimal points in the value but it rounds them up to 2 digit..
the only way around the two activity multipliers that i can think of is to calculate along the lines as follows (using 1.375 as example)
multiply bmr by 1.37 and add result to v_LA
multiply bmr by 1.38 and add result to v_LA
divide v_LA by 2 to get the average
however, i believe the output will still be limited to two decimal points which may end up with the same rolled up .. and i have run out of time to test that today.. i will leave you to think it through..
have a look at these three samples and tell me if i got it in the ballpark - understanding there will be a rounding error .. i can walk you through the logic in screen shots if that is where you are heading
Guys I’ve created a calorie calculator using typeform that outputs the TDEE and also the clients starting calories in accordance with their goals.
I used the same BMR equation that @jacef used, and the same activity levels that you used albeit 1.375 was rounded up to 1.38 and 1.725 was rounded up to 1.73.
I’m so grateful someone was able to create a form with TDEE. Is anyone able to help make a form just like this but that also calculates macronutrients such as Carbs, Protein & Fat based on their TDEE answers?
@Katie Scott - if you have the ‘formulae’ on a napkin, the logic can be created to render the details - or at least it should ie if the calories are 2400 and you want 30-30-40 split, the math is simple..
Hi gang, I’m struggling a bit with the how to set things up here. To keep this as simple as possible let’s just say I have an open text entry (number) where someone can enter their weight in lbs. Great. No problem. How do I create a variable that’ll store that entry squared?
Example: Weight entered = 180 (I can store that as a variable of @weight) I know I can create another variable @weight2 but how do I tell Typeform that @weight2 is @weight X @weight?
This is a really great thread. I am working on building a calorie calculator for my landing page in Typeform. Any suggestions on how to have the results trigger a conditional notification with a meal plan template attachment?
Hi @Debbie How are you currently measuring results from the form? Or, what are the different triggers in the form for different meal plans? Any additional information you can provide about your form or ideal setup would be helpful!
if weight is greater than 0 then add weight to to @weight2
if weight is greater than 0 then multiply @weight2 by weight
if you do that you will get the square..
= = = = =
That’s kind of what seems odd to me. I understand I’ll “get the square” from that. But is the square then stored as @weight2? What an odd way for Typeform to assign a variable if so.
Of course as all of us who build calorie and BMI calculators do - we’ll need to do some additional calculating.
One such formula for BMI is you take weight in kg divided by height in meters squared.
So I’m just trying to understand how Typeform stores variables so that these simple calculations can be handled. I’m very used to working with variables and doing these calculations but it seems Typeform handles this in an odd way (or it’s just me).
@Lifestyle180 - it’s an odd thing.. it took a while to figure it out but yes, not the way you do it in some application domains.
.. yes the square is stored in the @weight2 variable …..
and i understand the issues on the calculations.. it’s one of the things that i did as example about 2 years ago in here when someone was looking at how to make the calculations work. here’s the sample
I’ve built out about 20 different versions for folks, using typeform, who got hung up on the same issues for calculating and using variables .. after a while it becomes second nature..
I made a TDEE calculator with typeform and I have followed all the steps as described above, but still I fail to get the result of the formula in my final screen. Could you guys help me with this?
@Sportboost - to show the results on the ending screen, you would need to do something like the following:
simply type the ‘@’ sign and the variables in the form should show up - select the appropriate one to show - you can have an ending for male and an ending for female but you would need a logic rule on the last question that would route the user to the specific page. then display the appropriate variable on the screen in this fashion
i turned off the social icons and button using the toggles that i ‘highlghted’
if weight is greater than 0 then add weight to to @weight2
if weight is greater than 0 then multiply @weight2 by weight
if you do that you will get the square..
= = = = =
That’s kind of what seems odd to me. I understand I’ll “get the square” from that. But is the square then stored as @weight2? What an odd way for Typeform to assign a variable if so.
Of course as all of us who build calorie and BMI calculators do - we’ll need to do some additional calculating.
One such formula for BMI is you take weight in kg divided by height in meters squared.
So I’m just trying to understand how Typeform stores variables so that these simple calculations can be handled. I’m very used to working with variables and doing these calculations but it seems Typeform handles this in an odd way (or it’s just me).
Hello, I’ve just discovered this thread and i was hoping if someone could help me.
I too am trying to calculate the BMI of the user based on their answers.
The user will type their weight(kg) and their height(cm) and i want to create a variable so that i can save the calculation and present it on the last slide as a result.
Can someone please help me as to how do i proceed?