# MACRO Calculator For Fitness

so… I’ve gotten a basic calculator to work, but when it comes to this more complex problem… im not sure if it’s possible, I keep getting wrong answers and have tried multiple different combinations of code for this to work, but my brain is just melting over trying to figure this out… I do fitness, not this stuff, so it’s new territory lol

Equation is: 66.47 + (6.24 × weight in pounds) + (12.7 × height in inches) − (6.75 × age in years)
using 160 for weight, 70 inches for height and 30 for age
I should be getting 1692 but keep getting 3,012
from my understanding I need weight AND what the weight equation equals (6.24Xweight) so 2 variables for each number (for slider to show value to player, and the ‘hidden’ number which is the BMR equation for total BMR later)
is this even possible, or am I going to run myself into insanity here? i’ve gotten close (500 off) but can not get the correct answer… change things around and get a negative number or one that is so far off that I have NO idea why…

am I adding too much? too little? everything else is going smoothly but this has slowed me down

Hi and welcome!

I think you made a mistake here:

It should be: GlobalVariable(PersonaStats.Weight)

1 Like

WELL that would definitely explain a lot lol appreciate the feedback, another pair of eyes always help! currently busy, but will check on it as soon as i get the time and let you know

1 Like

Cool let me know if it all checks out.

sorry for taking a little longer than expected… life! but, it seems to be working now. numbers are slightly different from an online calculator but that could be from that calc rounding up decimals or something, will continue to work and tweak that… next part is adding protein/fats/carbs per day based off of BMR (this was just the start of the macros calculator, other parts should be MUCH easier though)