×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Too Many OR Statements - need loop

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

RE: Too Many OR Statements - need loop

(OP)
You are right...but it still bugs me that I cant get that loop to work. Thanks

RE: Too Many OR Statements - need loop

There are still brute force and ignorance approaches:

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

n:=0..6
Under1[n:=if(UC[n<1,"OK","NG")
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources