Top Description Fields Constructors Methods
org.apache.poi.ss.formula.atp

pack-priv final Class XLookupFunction

extends Object
implements FreeRefFunction, ArrayFunction
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.ArrayFunction, org.apache.poi.ss.formula.functions.FreeRefFunction
Imports
org.apache.poi.ss.formula.OperationEvaluationContext, .TwoDEval, org.apache.poi.ss.formula.eval.*, org.apache.poi.ss.formula.functions.ArrayFunction, .FreeRefFunction, .LookupUtils

Implementation of Excel function XLOOKUP() Syntax
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

https://support.microsoft.com/en-us/office/xlookup-function-b7fd680e-6d10-43e6-84f9-88eae8bf5929

Since
POI 5.2.0

Field Summary

Modifier and TypeField and Description
private final ArgumentsEvaluator
public static final FreeRefFunction

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private ValueEval
_evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex)

public ValueEval
evaluate(ValueEval[]
the pre-evaluated arguments for this function. args is never null, nor are any of its elements.
args
,
OperationEvaluationContext
primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.
ec
)

Implements org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

private ValueEval
evaluate(int srcRowIndex, int srcColumnIndex, ValueEval lookupEval, ValueEval indexEval, ValueEval returnEval, ValueEval notFound, LookupUtils.MatchMode matchMode, LookupUtils.SearchMode searchMode)

public ValueEval
evaluateArray(ValueEval[]
the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.
args
,
int
row index of the cell containing the formula under evaluation
srcRowIndex
,
int
column index of the cell containing the formula under evaluation
srcColumnIndex
)

Implements org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

private AreaEval
notFoundAreaEval(ValueEval notFound, int width)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

evaluatorback to summary
private final ArgumentsEvaluator evaluator
instanceback to summary
public static final FreeRefFunction instance

Constructor Detail

XLookupFunctionback to summary
private XLookupFunction(ArgumentsEvaluator anEvaluator)

Method Detail

_evaluateback to summary
private ValueEval _evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
evaluateback to summary
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec)

Implements org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

Parameters
args:ValueEval[]

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

the pre-evaluated arguments for this function. args is never null, nor are any of its elements.

ec:OperationEvaluationContext

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.

Returns:ValueEval

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

never null. Possibly an instance of ErrorEval in the case of a specified Excel error (Exceptions are never thrown to represent Excel errors).

Annotations
@Override
evaluateback to summary
private ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval lookupEval, ValueEval indexEval, ValueEval returnEval, ValueEval notFound, LookupUtils.MatchMode matchMode, LookupUtils.SearchMode searchMode)
evaluateArrayback to summary
public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex)

Implements org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

Parameters
args:ValueEval[]

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.

srcRowIndex:int

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

row index of the cell containing the formula under evaluation

srcColumnIndex:int

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

column index of the cell containing the formula under evaluation

Returns:ValueEval

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

The evaluated result, possibly an ErrorEval, never null

Note

- Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate to Double#NaN be sure to translate the result to ErrorEval#NUM_ERROR.

Annotations
@Override
notFoundAreaEvalback to summary
private AreaEval notFoundAreaEval(ValueEval notFound, int width)