Lookup

Syntax

Lookup( XTitle, YTitle, InterpMethod, X, X1, Y1, X2, Y2, ..., Xn, Yn)

Description

Looks up the value of an independent variable (X), and returns a value for a corresponding dependent variable (Y).  The set of N data points -- (X1, Y1), (X2, Y2), ..., (Xn, Yn) -- defines a function: f(X) = Y.  Given a value of X, the function determines the corresponding value of Y.  For example, if water demand is a function of water price, the X values would be water prices and the Y values would be the corresponding demand at that price.  For intermediate values of X between the data points, the InterpMethod defines how the Y value should be interpolated.  Valid interpolation methods are Linear and Step.  There is no extrapolation -- values of X less than X1 will equal Y1; values of X greater than Xn will equal Yn.

Tip: The easiest way to construct a Lookup expression is using the Lookup Function Wizard, which also allows you to paste an array from Excel. Click the dropdown arrow on the expression box and choose "Lookup Function Wizard."

Example

Using linear interpolation:

Lookup( Price[$], Demand[m^3], Linear, \Key\Water Price, 0.10, 2000, 0.50, 1000, 1.0, 100)    ; X is water price and Y is water demand.  As price goes up, demand goes down.

\Key\Water Price

Value of Lookup expression

0.05

2000

0.25

1625

0.50

1000

0.75

550

1.00

100

1.50

100

Using step interpolation:

Lookup( Price[$], Demand[m^3], Step, \Key\Water Price, 0.10, 2000, 0.50, 1000, 1.0, 100)    ; X is water price and Y is water demand.  As price goes up, demand goes down.

\Key\Water Price

Value of Lookup expression

0.05

2000

0.25

2000

0.50

1000

0.75

1000

1.00

100

1.50

100