Jump to content

This topic is 7500 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am probably overlooking something but for the life of me I cannot figure out how to put an If statement into a calculation...here is my calculation so far:

655 + (9.6 * (weight / 2.2)) + (1.7 * (height * 2.54)) - (4.7 * age)

Now I have another field that is a value list called Activity Level. I need the choices in the list to equal a numerical value. So Sedentary=1.2 Light=1.375 Moderate=1.55 Very=1.725 Extra=1.9

I need the result of the above calculation to be multiplied by the activity level. First how do I make the value list choices equal a numerical value and then how do I finish my calculation with the If statement (if that's what I should be using?).

Thx

Posted

(655 + 9.6 * (weight / 2.2) + 1.7 * height * 2.54 - 4.7 * age) * Case( ActivityLevel = "sedentary", 1.2, ActivityLevel = "light", 1.375, ActivityLevel = "moderate", 1.55, ActivityLevel = "very", 1.725, ActivityLevel = "extra", 1.9 )

Posted

EXCELLENT!! So the Case function is in the Logical group....now is this always the format I will use whenever trying to "convert" text to a numerical value?

Thank you for your VERY fast reply Queue!!!!!

Posted

For the most part, yes. But it depends on the setup as to what will work best for a given situation.

This topic is 7500 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.