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!

Calculate if different is less

Status
Not open for further replies.

Joe1010

Programmer
Dec 11, 2006
49
US
I used this formula to identify the different

If ({@Diff}) >4.99 and ({@Diff}) < 10 then "5-10" else
If ({@Diff}) >9.99 and ({@Diff}) < 20 then "10-15" else
"N/A"

However, so me differences are a negative. I would like to changes the formula like this, if the diff is more display “A1” if it is less, between 0-5 display “0-5”
If it is between 5-10 less, display “5-10”

What is the formula?

Thank you
 
Try:

If ({@Diff}) <= 4.99 then
"A1"
else
If ({@Diff}) > 4.99
and
({@Diff}) < 10 then
"5-10"
else
If ({@Diff}) >9.99
and ({@Diff}) < 20 then
"10-15"
else
"N/A"

Or change the <=4.99 to whatever is appropriate, the point is to allow for all value ranges.

-k
 
Let me clarify my problem.

If the different is more than 0, then display “Good” that means that I will make more profit.

If the Diff is less than 0, then
If it is between 0 and 5 below, then display “0-5”
If it is between 5 and 10 below, then display “5-10”

How can this be done?
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top