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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Create a "vlookup" in MathCAD Prime 3.0?

dsochor
10-Marble

Create a "vlookup" in MathCAD Prime 3.0?

Is it possible to perform a pseudo “vlookup” in MathCAD prime 3.0? Using the attached spreadsheet, I’m attempting to have MathCAD look for a value in the B column (W8x35 for example) and then once it finds it, have MathCAD set variable “rx” equal to value in column AP, “ry” equal to the value in column AT etc. Is this possible with prime 3.0?

ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:dsochor)

It's case sensitive. Change the lower case x to an upper case X: W44X335.

Note that the result is returned as a single element vector. If you want a scalar put a subscript (type "[0") after the closing parenthesis.

View solution in original post

6 REPLIES 6
RichardJ
19-Tanzanite
(To:dsochor)

Sure. Just use vlookup multiple times, once for rx, once for ry, etc.

Or did I miss something in your question?

Maybe the attached Prime worksheet and excel are better able to show the issue I'm having. I'm attempting to do what you recommend but my defining of variables has an error. Might you know what I am doing incorrect?

RichardJ
19-Tanzanite
(To:dsochor)

I see. Using letters as column designators is unique to spreadsheets. Mathcad indexes columns the same way as it indexes rows: using numbers that start at the global variable ORIGIN. By default ORIGIN=0, so column AQ in Excel is column 42 in Mathcad. READEXCEL puts the content of the spreadsheet in the matrix AISC, which you must then index using numbers, not Excel's letter designators.

Thank you Richard, is there anything else that needs to be done beyond referencing the column by number? Changing the value to 42 doesn't seem to make the function work.

RichardJ
19-Tanzanite
(To:dsochor)

It's case sensitive. Change the lower case x to an upper case X: W44X335.

Note that the result is returned as a single element vector. If you want a scalar put a subscript (type "[0") after the closing parenthesis.

Richard - thank you very much!

Announcements

Top Tags