Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

how to get hlookup to output a scalar

Status
Not open for further replies.

bkrell

Structural
Nov 17, 2010
6
I'm trying to get the hlookup function to output a value of a matrix given a string or value to match in a header row, the lookup matrix, and known row number. i.e.

seed:= "ex"

R: [0 "ex" 1
2 3 4
5 6 7]

As I have it written now, MathCAD outputs

solution:= hlookup(seed,R,2)= (3)

I would like hlookup(seed,R,2) to output the just scalar value of the matrix entry instead of the vector. Is there a setting or another function to "scalarize" the output? The vlookup() function has the same issue. I'd like to use hlookup or vlookup, so the seed can be a prompted string or value.

Thanks for any help.
 
Replies continue below

Recommended for you

Just index it:
solution:hlookup(seed,R,2)[0 or [1

since it looks like your origin is set to 1 and not 0

TTFN

FAQ731-376
 
Thanks. I do set the origin to 1, and of course the answer was hiding right under my nose.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor