IF Formula – TDEE
-
Hi,
I’m trying to build a TDEE calculator for my website
To view a replica, please see this link:
https://www.fitnessfrog.com/calculators/tdee-calculator.htmlBasically, it involves BMR x activity factor.
I have no problems with creating a BMR calculator. However, I am struggling to come up with the IF formula that factors in the activity factor.
This is what I have at the moment. Can you please guide me in the right direction?
Thanks
Note:
fieldname 7 = gender (1 = male, 2 = female)
fieldname 11 = activity factor
where activity factor 1 =, multiply BMR by 1.2
where af = 2, multiply by 1.375
where af = 3, multiply by 1.55
…
etc(function(){
if(fieldname7==’1′, fieldname11==’1′){
return (66+fieldname5*13.7+fieldname4*5-fieldname2*6.8)*1.2;
if(fieldname7==’1′, fieldname11==’2′){
return (66+fieldname5*13.7+fieldname4*5-fieldname2*6.8)*1.375;
if(fieldname7==’1′, fieldname11==’3′){
return (66+fieldname5*13.7+fieldname4*5-fieldname2*6.8)*1.55;
if(fieldname7==’1′, fieldname11==’4′){
return (66+fieldname5*13.7+fieldname4*5-fieldname2*6.8)*1.725;
if(fieldname7==’1′, fieldname11==’5′){
return (66+fieldname5*13.7+fieldname4*5-fieldname2*6.8)*1.9;
if(fieldname7==’2′, fieldname11==’1′){
return (655+fieldname5*9.6+fieldname4*1.8-fieldname2*4.7)*1.2;
if(fieldname7==’2′, fieldname11==’2′){
return (655+fieldname5*9.6+fieldname4*1.8-fieldname2*4.7)*1.375;
if(fieldname7==’2′, fieldname11==’3′){
return (655+fieldname5*9.6+fieldname4*1.8-fieldname2*4.7)*1.55;
if(fieldname7==’2′, fieldname11==’4′){
return (655+fieldname5*9.6+fieldname4*1.8-fieldname2*4.7)*1.725;
if(fieldname7==’2′, fieldname11==’5′){
return (655+fieldname5*9.6+fieldname4*1.8-fieldname2*4.7)*1.9;
}
})()
- The topic ‘IF Formula – TDEE’ is closed to new replies.