Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If then else statements not working 1

Status
Not open for further replies.

VickieT

Technical User
Feb 18, 2004
35
US
I have the following formula written but it doesn't return the values as I'm asking it to.

These are long term disability and short term disability calculations as my customer would like them:

STD
Annual salary /52 x .60 x .029=monthly deduction with the maximum monthly deduction not greater than $29.00.

LTD
Annual salary / 12 x .60 x .029=monthly deduction with the maximum monthly deduction not greater than $19.84.

Explanations of the formulas inside the formula I wrote:
The formula @annual salary is calculated for the annual salary based on shifts and hourly wage. The else statement at the end, @dedamt, applies to the other Bended codes that do not need calculations but simply the amount * 2.

Here's the formula I wrote:

If {ESYEMBDD.BENDED_CODE}= "ltd" then if {@annual salary} / 12 * .60 * .029 >= 19.84 then 19.84 else
{@annual salary} / 12 * .60 * .029 else
If {ESYEMBDD.BENDED_CODE}= "std" then if {@annual salary} / 52 * .60 * .029 >= 29.00 then 29.00 else
{@annual salary} / 52 * .029
else {@Dedamt}

It seems to disregard the >= portion of the formula and returns the actual values. I hope this is enough information. Can you help? Thanks.
 
Try:

If {ESYEMBDD.BENDED_CODE}= "ltd" then
(
if (({@annual salary} / 12) * .60) * .029 >= 19.84 then 19.84
else
(({@annual salary} / 12) * .60) * .029
)
else
If {ESYEMBDD.BENDED_CODE}= "std" then
(
if (({@annual salary} / 52) * .60) * .029 >= 29.00 then
29.00
else
({@annual salary} / 52) * .029
)
else {@Dedamt}

For debug purposes I would create a formula to display alongside containing:

(({@annual salary} / 52) * .60) * .029

-k
 
Thanks for your reply but it still isn't returning the >= value. If it goes over those values it still shows the value.
 
You were absolutely correct! My customer's formula was incorrect by one number. Once she corrected it for me, the formula you helped me with worked beautifully. Thanks again.

Vickie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top