Too Many OR Statements - need loop
Too Many OR Statements - need loop
(OP)
If I have a unity check matrix:
.67
.90
.55
UC = .54
.90
1.03
.68
I want it to do a check of all the numbers in the matrix and if a number is above one I want it to say "NG", otherwise write "OK". However I dont want to do a bunch of OR statements because the real matrix is a lot bigger (if UC[1]>1 OR UC[2]>1,...,etc).
How can I create a loop that does the same thing? Right now I doing if UC[n]>1 then "NG" but it doesnt seem to want to run the way I wrote it.
Thanks
.67
.90
.55
UC = .54
.90
1.03
.68
I want it to do a check of all the numbers in the matrix and if a number is above one I want it to say "NG", otherwise write "OK". However I dont want to do a bunch of OR statements because the real matrix is a lot bigger (if UC[1]>1 OR UC[2]>1,...,etc).
How can I create a loop that does the same thing? Right now I doing if UC[n]>1 then "NG" but it doesnt seem to want to run the way I wrote it.
Thanks





RE: Too Many OR Statements - need loop
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Too Many OR Statements - need loop
RE: Too Many OR Statements - need loop
IF(SUM(IF(a[n >= 1,1,0), "NG" , "OK"))) is one approach, where SUM is the summation operator. You essentially do a SUMIF the value is greater than or equal to 1, and if the sum is greater than 0, then the second if outputs "NG, otherwise "OK" There is a bit of a cheat, since you should do IF(SUM(blah)>0
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Too Many OR Statements - need loop
Under1[n:=if(UC[n<1,"OK","NG")