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?
Solved! Go to Solution.
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.
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?
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.
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!