Contents - Index


LOOKUPROW and LOOKUPROW1

 

The LookupRow function scans a specified column of tabular data in a Lookup table or Lookup file and returns the row in this table in which the numerical value is equal to a specified value.  A bisection method is used in finding the row using all of the data in the column.  The LookupRow1 operates in a similar manner except that it ignores data in the first row of the Lookup table.  Use the LOOKUP$ROW function to find the row in which a string value is located.

 

Note that the INTERPOLATE and INTERPOLATE2DM functions combine the functions of the Lookup and LookupRow commands, and they are somewhat more convenient to use.  

 

The function requires three arguments.  The first argument is a (case-insensitive) string constant or string variable that provides the name of the Lookup table in the Lookup Window or the name of an existing Lookup file. The string constant must be enclosed within single quote marks.  Lookup table names appear on the tabs at the top of the Lookup Table Window.   EES recognizes both binary and ASCII forms for Lookup files (stored on disk), identified by the filename extensions of .LKT, .CSV, .TXT, and .DAT.  If a filename extension is not provided, EES assumes the binary form for the Lookup file and internally adds .LKT.  See Lookup file Formats for additional information.

 

The next arguments are the column in the table and a target value.  The function will return the row corresponding to the target value.  The row value returned will not necessarily be an integer.  Interpolation between rows will be provided as needed.  The column may be indicated in several values.  First, it may be entered as an integer value.  Alternatively, it may be entered by providing the column name as a string constant or a string variable.   The function will return the row in the Lookup Table corresponding to the value supplied as the second argument.  The row value returned will not necessarily be an integer. Interpolation between rows will be provided as needed.   Note that the data in the specified column of the table must be monotonic, i.e., increasing or decreasing.  The LookupRow function will fail to find a correct result if this is not the case.  

 

The purpose of the LookupRow function is to provide a means of relating tabular information in different columns of a specified Lookup Table.  For example, suppose you have created a Lookup table called VISCDATA in which you have entered the temperature in the first column (titled TEMP) and the viscosity at that temperature in the second column (titled VISC).  The row corresponding to a temperature of 100 will be returned with LookupRow('VISCDATA', 'TEMP',100).  The viscosity corresponding to that temperature is then Lookup('VISCDATA', LookupRow('VISCDATA', 'TEMP', 100), 'VISC').  Note that the Interpolate functions have a similar function to Lookup and LookupRow and they are easier to use. 

 

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

 

 

Example: 

X=LookupRow('Lookup 1',2, 35.7) {locate the row in Column 2 of table Lookup 1 that has a value of 35.7, interpolating as needed}

 

 

See also:

LOOKUP    

LOOKUPCOL

LOOKUP$ROW

INTERPOLATE  

INTERPOLATE1  

INTERPOLATE2  

INTERPOLATE2DM

Mathematical functions