4 Replies Latest reply on Dec 17, 2014 6:14 AM by philmodjunk

    Help with If statement

    danlee

      Title

      Help with If statement

      Post

      If a calculation for BMRCalculator field is under 1200 then I want this formula to run.  This formula is in the CalorieNonWODay field.  I want 1200 to be default number that shows up for CalorieNonWODay unless the total for BMRCalculator is 1200 or greater.  How do I add that option to this formula?

      Case ( ActivityLevelPossibleDelete = "Sedentary" ;(1.2 * BMRCalculator) - 500;
      ActivityLevelPossibleDelete = "Lightly active (light exercise 1-3 days/week)";(1.375 * BMRCalculator) - 500;
      ActivityLevelPossibleDelete = "Moderatetely active (moderate exercise 3-5 days/week)" ;(1.55 * BMRCalculator) - 500;
      ActivityLevelPossibleDelete = "Very active (hard exercise 6-7 days a week)" ;(1.725 * BMRCalculator)-500)

        • 1. Re: Help with If statement
          philmodjunk

          Case (

          BMRCalculator < 1200 ; 1200;
          ActivityLevelPossibleDelete = "Sedentary" ;(1.2 * BMRCalculator) - 500;
          ActivityLevelPossibleDelete = "Lightly active (light exercise 1-3 days/week)";(1.375 * BMRCalculator) - 500;
          ActivityLevelPossibleDelete = "Moderatetely active (moderate exercise 3-5 days/week)" ;(1.55 * BMRCalculator) - 500;
          ActivityLevelPossibleDelete = "Very active (hard exercise 6-7 days a week)" ;(1.725 * BMRCalculator)-500

          ) // case

          • 2. Re: Help with If statement
            danlee

            Thank you but when I try this 1200 does not change in the CalorieNonWorkoutDay field.  Even if the BMRCalculator is above 1200...

            • 3. Re: Help with If statement
              Sorbsbuster

              Add the field BMRCalculator and the ActivityLevelPossibleDelete field to the layout, beside the CalorieNonWODay result.  Check that when you change the BMRCalculator field and the ActivityLevelPossibleDelete field they do indeed contain the data you expect, ie exactly "Very active (hard exercise 6-7 days a week)" (no quotation marks), for example.  Also check that ActivityLevelPossibleDelete  is defined as a text field.

              Also note the typo: Moderatetely

              • 4. Re: Help with If statement
                philmodjunk

                Make Sure that the result type for BMRCalculator specifies a Number result.