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

Need a calculation to return a positive number 1

Status
Not open for further replies.

SethP

Technical User
Apr 21, 2002
19
0
0
US
I need to create a calculation that will return a positive number. I have a form that compares two fields: actual inventory counts and original inventory counts. I would like to take the difference of the two fields and divide that number by the actual inventory count to receieve a percentage of varience.

IE:
Origianal Actual Varience (what I would like to see)
100 90 0.10
200 210 0.05 (not -0.05)
300 300 0.00

Any Ideas?
 
if less than 0 then multiply by -1


Thanks,
John McKenney
Work Hard... Play Harder
 
Seth,

Wrap your varience calculation with the Abs function.

It will give you the absolute value.


Steve
 
try abs (Absolute Value), like 5-8 = -3, but abs(5-8)=3. Positive numbers are also returned as positive.

ChaZ



Ascii dumb question, get a dumb Ansi
 
Blorf-
Works good!
Thanks all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top