Skip to main content
1-Visitor
December 7, 2010
Solved

Scalar Values from VLOOKUP?

  • December 7, 2010
  • 13 replies
  • 7858 views

I've used some VLOOKUP functions to extract data, for instance the yield strength of a material if the material name is known. Unfortunately the value returned is an array (a 1 x 1 array, but an array nonetheless). Using this in a logical equation in an "if ... otherwise" program ( if x < y where the y comes from the VLOOKUP) does not seem to work. I get an error message that the computed value must be a scalar.

How do I convert the value to a scalar?

Thanks!

Best answer by StuartBruff

select the expression that contains the result and apply the matrix subscript operator ('[' from the keyboard or from the matrix toolbar) and type 0 (assuming that you have selected 0-based indexing for matrices).

eg (taken from the lookup Quicksheet - you can get to it from the Help on lookup functions)

model:=vlookup(9, CARS,1)

model = (15)

model[0= 15

or cut out the middleman

model:=vlookup(9,CARS,1)[0

model=15

13 replies

23-Emerald V
December 7, 2010

select the expression that contains the result and apply the matrix subscript operator ('[' from the keyboard or from the matrix toolbar) and type 0 (assuming that you have selected 0-based indexing for matrices).

eg (taken from the lookup Quicksheet - you can get to it from the Help on lookup functions)

model:=vlookup(9, CARS,1)

model = (15)

model[0= 15

or cut out the middleman

model:=vlookup(9,CARS,1)[0

model=15

1-Visitor
December 7, 2010

Thank you, Stuart!