Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

the 'if' command 1

Status
Not open for further replies.

DJYork

Structural
Sep 22, 2004
57
I want a calculation to tell me if something is 'OK' or 'NG'. How do I write it in MathCAD? I can do it in excell, but unfamiliar with MathCAD.

ex. A=1
B=2

=if(A<B,OK,NG)

Granted that did nto work, and tried putting quotes but still not working. Any help would be greatly appreciated.
 
Replies continue below

Recommended for you

None of those statements will work as intended. I suggest you do the tutorials.



Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Move the equal sign on the if statement to the right.

A:=1
B:=2
if(A<B,"OK","NG")=

Or assign to a variable:
Answer:=if(A<B,"OK","NG")
Answer=

Peter
 
To use the If tehn else function you need to use programming. The construct is quite simple but difficult to explain in a text environment such as this fourm.

The help file is quite specific in not typing the words "if" or "otherwise" in the construct as they WONT work.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor