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

is there an "if(iserror)" function equivalent in mathcad

Status
Not open for further replies.

zhag2010

Mechanical
Joined
Jan 31, 2012
Messages
3
Location
US
Here is the situation:

I have
Table Z (5x5 matrix where each ; indicates a new row)

A,B,C,D,E; F,G,H,I,J; K,L,M,N,O; P,Q,R,S,T; U,V,W,X,Y

My inputs are F K P U and my column headers are A B C D E

if you are familiar with vhlookup, the original equation can look like this:

example1:=vhlookup(K,D,Z) where the equation looks for value K in the first column and looks for D in the first row all in table Z

example1 = N.



Now lets say I want example2 to look for the input "test"

the equation looks like this

example2:=vhlookup(test,D,Z)

however since "test" is not located in column 1 there is an error, example2 will highlight red.


BUT I want example2 to return an alternative value if there is not a match using vhlookup. I want this value to be "backup"



summary:

example2:=vhlookup(K,D,Z)
example:=N
example2:=vhlookup(test,D,Z)
example2=backup


Excel has a function like this:

example:=iferror(vhlookup(test,D,Z),backup)


 
example2:=vhlookup(text,D,Z) on error backup

"on error" is a function built into mathcads programming toolbar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top