사람들의 TDEE를 계산할 때 Harris Benedict Equation을 사용하고 있습니다. Google 시트를 사용하여 일종의 양식을 만들었지 만 Google 시트는 일하기가 어렵습니다. 수식 구문 분석 오류가 나타납니다. 포맷은 매우 유감스러운 일입니다.다중 중첩 된 IF 문을 사용하여 피트니스 계산기 디버깅
나는 작은 쉼표 또는 괄호 오류를 어딘가에서 만들고 있음을 알고 있지만 어디 있는지 모르겠습니다.
코드는 사람들이 미터법/영국식, 남성/여성, 키, 몸무게, 활동 수준 및 나이를 선호하는지 묻는 것으로되어 있습니다.
다음은 Google 시트가 수행하는 방법입니다. if statements. 그것은
은 - 거의 IF (A2 = "foo", "A2가 foo는") (논리 _ 표현식, TRUE 인 _ 경우 _ 값, FALSE 인 _ 경우 _)=IF (D9=”Imperial”,
IF(D10=”Male”,
IF(D16=”Sedentary (no exercise)”,
66 + (6.2 x D14) + (12.7 x (D13x12+G13)) – (6.76 x D12)x1.2,
IF(D16=”Lightly Active (1-3 days of exercise/week)”,
66 + (6.2 x D14) + (12.7 x (D13x12+G13)) – (6.76 x D12)x1.375,
IF(D16=”Moderately Active (3-5 days of exercise/week)”,
66 + (6.2 x D14) + (12.7 x (D13x12+G13)) – (6.76 x D12)x1.55,
IF(D16=”Very Active(6-7 days of exercise/week)”,
66 + (6.2 x D14) + (12.7 x (D13x12+G13)) – (6.76 x D12)x1.725,
IF(D16=”Extremely Active(exercise twice a day)”,
66 + (6.2 x D14) + (12.7 x (D13x12+G13)) – (6.76 x D12)x1.9,
“ “)))))
IF(D16=”Sedentary (no exercise)”,
655.1 + (4.35 x D14) + (4.7 x (D13x12+G13)) - (4.7 x D12) x1.2,
IF(Lightly Active (1-3 days of exercise/week)”,
655.1 + (4.35 x D14) + (4.7 x (D13x12+G13)) - (4.7 x D12) x1.375,
IF(Moderately Active (3-5 days of exercise/week)”,
655.1 + (4.35 x D14) + (4.7 x (D13x12+G13)) - (4.7 x D12) x1.55,
IF(D16=”Very Active(6-7 days of exercise/week)”,
655.1 + (4.35 x D14) + (4.7 x (D13x12+G13)) - (4.7 x D12) x1.725,
IF(D16=”Extremely Active(exercise twice a day)”,
655.1 + (4.35 x D14) + (4.7 x (D13x12+G13)) - (4.7 x D12) x1.9,
“ “))))))
IF(D10=”Male”,
IF(D16=”Sedentary (no exercise)”,
66.5 + (13.75 x D14) + (5.003 x D13) – (6.755 x D12)x1.2,
IF(Lightly Active (1-3 days of exercise/week)”,
66.5 + (13.75 x D14) + (5.003 x D13) – (6.755 x D12)x1.375,
IF(Moderately Active (3-5 days of exercise/week)”,
66.5 + (13.75 x D14) + (5.003 x D13) – (6.755 x D12)x1.55,
IF(D16=”Very Active(6-7 days of exercise/week)”
66.5 + (13.75 x D14) + (5.003 x D13) – (6.755 x D12)x1.725,
IF(D16=”Extremely Active(exercise twice a day)”,
66.5 + (13.75 x D14) + (5.003 x D13) – (6.755 x D12)x1.9,
“ “)))))
IF(D16=”Sedentary (no exercise)”,
655.1 + (9.563 x D14) + (1.850 x D13) – (4.676 x D12) x1.2,
IF(Lightly Active (1-3 days of exercise/week)”,
655.1 + (9.563 x D14) + (1.850 x D13) – (4.676 x D12) x1.375,
IF(Moderately Active (3-5 days of exercise/week)”,
655.1 + (9.563 x D14) + (1.850 x D13) – (4.676 x D12) x1.55,
IF(D16=”Very Active(6-7 days of exercise/week)”,
655.1 + (9.563 x D14) + (1.850 x D13) – (4.676 x D12) x1.725,
IF(D16=”Extremely Active(exercise twice a day)”,
655.1 + (9.563 x D14) + (1.850 x D13) – (4.676 x D12) x1.9,
“ “))))))
)