cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

VLOOKUP function - optional function

tcebulla
1-Visitor

VLOOKUP function - optional function

Hey I am trying to use VLOOKUP function to search a value....

and I want the answer to be "0"... when an exact match is not found... suggest..how can we do it...

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:tcebulla)

vlookup returns a vector, so use indexing to get at the value and then assign that to S as required.

Stuart

View solution in original post

6 REPLIES 6
StuartBruff
23-Emerald III
(To:tcebulla)

Replace NaN with 0 in the above example; uses the programming construct "on error" to trap the vlookup no-match error.

Stuart

Perhaps my problem is still there.... As I am trying to use VLOOKUP for not a single variable but for a range of variables..

Can you suggest how can I solve the following problem.... I have reaction matrix...at the restraint nodes..in order to calculate shear force and generalire the calculation for shear force.. I need a matrix S..which gives a value of zero at the unrestrained nodes....

try.PNG

StuartBruff
23-Emerald III
(To:tcebulla)

vlookup returns a vector, so use indexing to get at the value and then assign that to S as required.

Stuart

StuartBruff
23-Emerald III
(To:StuartBruff)

Of course, there's usually more than one way to skin a cat in Mathcad ...

Stuart

Hey..is there any way... I can convert this matrix (1 x 1) to scalar... it would solve my problem...

StuartBruff
23-Emerald III
(To:tcebulla)

Thomas Cebulla wrote:

Hey..is there any way... I can convert this matrix (1 x 1) to scalar... it would solve my problem...

??  See the above ... that's what the array index does (the small subscript 1 at the end of the vlookup expression).

Stuart

Announcements

Top Tags