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!

MULTIPL CRITERIA FORMULA USING IF

Status
Not open for further replies.

mravimtnl

MIS
Nov 1, 2009
47
i HAVE FOUR FORMULAS F1,F2,F3,F4. iN THESE ON OF THE M WILL HAVE VALU GREATER THAN OTHER EQUAL TO ZERO OR NULL VALUES. i HAVE CREATED FORMULA F5 TO GET THE VALUE WHICH IS MORE THAN 0 OUT OF FOR FORMULAS:

NUMBERVAR F7
IF F1>0 THEN f7:=F1 ELSE
IF F2>0 THEN F7:=F2 ELSE
IF F3>0 THEN F7:=F3 ELSE
IF F4>0 THEN F7:=F4
ELSE 10000

BUT I AM NOT GETTING THE RESSULT.
 
Please rewrite--as you have left out words/letters, and please do not use upper case. I can't tell if you are saying the formulas can be null or not.

-LB
 
What result are you getting?!?

FYI: I would set F7:= 10000 at the last else. Put a semi-colon after the If statement. Then just put in F7 on the last line (by itself).
 
I have re written formula like this. But only the first statement is being executed. i.e whenever there is a value it is being picked up for f1 but remaining others are shown as null:


NUMBERVAR F7;

IF {@f1}>0 THEN F7:={@f1}
else if {@f2}>0 then F7:= {@f2}
else if {@f2}>0 then F7:= {@f3}
else if {@f2}>0 then F7:= {@f4}
else if {@f2}>0 then F7:= {@f5}
else F7:=1000000;
F7;

Note: {f1).{f2}etc can hold 1,0, or null values.

 
I have tried this formula also:


NUMBERVAR F7;

IF (Not isnull({@f1}) or {@f1}>0) THEN F7:={@f1}
else if ( Not isnull({@f2}) or {@f2}>0) then F7:= {@f2}
else if (Not isnull({@f3}) or {@f3}>0) then F7:= {@f3}
else if (Not isnull({@f4}) or {@f4}>0) then F7:= {@f4}
else if (Not isnull({@f5}) or {@f5}>0) then F7:= {@f5}
else F7:=1000000;
F7;

but only the first if is being executes not others
 
Thank for your support. I got the desired result using this formula


NUMBERVAR F7;
if Not isnull({@f1}) then F7:= {@f1}
else if Not isnull({@f2}) then F7:= {@f2}
else if Not isnull({@f3}) then F7:= {@f3}
else if Not isnull({@f4}) then F7:= {@f4}
else if Not isnull({@f5}) then F7:= {@f5}
else F7:=1000000;
F7;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top