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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Greater Than Less Than Formula

Status
Not open for further replies.

tnbristol24

Technical User
May 25, 2011
2
US
I need to know if there is a function for "but"


if {@Balance Due}>=2*{@Monthly} then {@Monthly} Else

if {@Balance Due}>2*{@Monthly} but <3*{@Monthly} then {@Balance Due}-{@monthly}*2 else

0.00

Thank you in advance for any help.

Toni
 
Try the following:
Code:
If 	{@Balance Due} >= 2*{@Monthly} 
Then 	{@Monthly} 
Else 
If 	{@Balance Due} > 2*{@Monthly} and
	{@Balance Due} < 3*{@Monthly} 
Then 	{@Balance Due}-({@monthly}*2) 
Else	0

Basically you just add an additional test using and. Note I have also added brackets around {@monthly}*2 so as to force (what I think is) the correct order of calculation.

Cheers
Pete
 
Thanks pmax9999

It didn't work the way I had hoped it would.

What I'm trying to do is create formulas for Aging: Current 30 Days 60 Days...

I'm getting the right amount in the current field but it is still giving an amount of 0.00 when it should be $353.91

Balance Due: 707.91
Monthly: 354.00

Any suggestion on how to correct it?

Thanks again.

Toni
 
Ok, I see the problem. The reason it is returning zero is because it defaults to the final value (0) as the balance due is not more than twice the monthly value.

It also raises another issue with your logic that I hadn't picked up, in that the first test will pick up everything where the balance due is more than twice the monthly amount, and so the second test will never be used.

I am not sure I fully understand what you are attempting, but the following formula should return the correct result for this particular example.

Code:
If 	{@Balance Due} >= 2*{@Monthly} and
	{@Balance Due} <  3*{@Monthly} 
Then 	{@Balance Due} - ({@monthly}*2) 
Else 	{@Balance Due} - {@monthly}

This doesn't deal with anything where it is more than 3 mayments in arrears - you would need to add addition if-then-else statments to deal with that.

You will need to provide more sample data and examples of your expected reults to deal with different situations.

Pete
 
One problem is that you have the wrong direction in the first line of your formula. I think you mean to say:

if {@Balance Due} [red]<=[/red]2*{@Monthly} then
{@Monthly} Else
if {@Balance Due}>2*{@Monthly}and
{@Balance Due} <3*{@Monthly} then //etc.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top