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

Help with a calculation formula

Status
Not open for further replies.

chris35

Technical User
Apr 21, 2003
24
0
0
US
I work for a hospital and am dealing with test codes and test results. I am wondering how to write a formula that calculates a ratio using data from multiple selected fields. The calculation needs to be "R1/R2 X 10". R1 represents the result from one test code and R2 is the result from a different test code.

The report is set up to return the results for these test codes but is selected for a "battery code" (group of tests ordered) that contains these test codes. I am assuming that in the formula I need to select for one test code and have it drop in the result from that code (these are two different fields) and then do the same for the other. How would a formula for something like this look? I am out of ideas. Thanks for any help.
 
hi
try this formula
---------------------
@ratio
if
R1 = 0
then
0
else
(R1/R2)*10
---------------------
the reason for if r1 = 0 is to prevent division by zero and not get error

cheer

pgtek
 
That's great, but I need to know how to define R1 and R2 first. I need to select for {order.test code} first and then make the {order.result} from that test code equal to R1, same for R2, all in the formula (or another formula that I can reference).

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top