ExcelMatch
in package
uses
ArrayEnabled
Table of Contents
Constants
Properties
Methods
- MATCH() : array<string|int, mixed>|float|int|string
- MATCH.
- evaluateArrayArguments() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
- evaluateArrayArgumentsIgnore() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
- evaluateArrayArgumentsSubset() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
- evaluateArrayArgumentsSubsetFrom() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
- evaluateSingleArgumentArray() : array<string|int, mixed>
- Handles array argument processing when the function accepts a single argument that can be an array argument.
- initialiseHelper() : void
- matchFirstValue() : int|string|null
- matchLargestValue() : mixed
- matchSmallestValue() : int|string|null
- prepareLookupArray() : array<string|int, mixed>
- testFalse() : bool
- validateLookupArray() : void
- validateLookupValue() : void
- validateMatchType() : int
Constants
MATCHTYPE_FIRST_VALUE
public
mixed
MATCHTYPE_FIRST_VALUE
= 0
MATCHTYPE_LARGEST_VALUE
public
mixed
MATCHTYPE_LARGEST_VALUE
= 1
MATCHTYPE_SMALLEST_VALUE
public
mixed
MATCHTYPE_SMALLEST_VALUE
= -1
Properties
$arrayArgumentHelper
private
static ArrayArgumentHelper
$arrayArgumentHelper
$initializationNeeded
private
static bool
$initializationNeeded
= true
Methods
MATCH()
MATCH.
public
static MATCH(mixed $lookupValue, mixed $lookupArray[, mixed $matchType = self::MATCHTYPE_LARGEST_VALUE ]) : array<string|int, mixed>|float|int|string
The MATCH function searches for a specified item in a range of cells
Excel Function: =MATCH(lookup_value, lookup_array, [match_type])
Parameters
- $lookupValue : mixed
-
The value that you want to match in lookup_array
- $lookupArray : mixed
-
The range of cells being searched
- $matchType : mixed = self::MATCHTYPE_LARGEST_VALUE
-
The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below. If match_type is 1 or -1, the list has to be ordered.
Return values
array<string|int, mixed>|float|int|string —The relative position of the found item
evaluateArrayArguments()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
protected
static evaluateArrayArguments(callable $method, mixed ...$arguments) : array<string|int, mixed>
Example use for: ROUND() or DATE().
Parameters
- $method : callable
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsIgnore()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
protected
static evaluateArrayArgumentsIgnore(callable $method, int $ignore, mixed ...$arguments) : array<string|int, mixed>
Example use for: HLOOKUP() and VLOOKUP(), where argument 1 is a matrix that needs to be treated as a database rather than as an array argument.
Parameters
- $method : callable
- $ignore : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubset()
Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
protected
static evaluateArrayArgumentsSubset(callable $method, int $limit, mixed ...$arguments) : array<string|int, mixed>
Example use for: NETWORKDAYS() or CONCATENATE(), where the last argument is a matrix (or a series of values) that need to be treated as a such rather than as an array arguments.
Parameters
- $method : callable
- $limit : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubsetFrom()
Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
protected
static evaluateArrayArgumentsSubsetFrom(callable $method, int $start, mixed ...$arguments) : array<string|int, mixed>
Example use for: Z.TEST() or INDEX(), where the first argument 1 is a matrix that needs to be treated as a dataset rather than as an array argument.
Parameters
- $method : callable
- $start : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateSingleArgumentArray()
Handles array argument processing when the function accepts a single argument that can be an array argument.
protected
static evaluateSingleArgumentArray(callable $method, array<string|int, mixed> $values) : array<string|int, mixed>
Example use for: DAYOFMONTH() or FACT().
Parameters
- $method : callable
- $values : array<string|int, mixed>
Return values
array<string|int, mixed>initialiseHelper()
private
static initialiseHelper(array<string|int, mixed>|false $arguments) : void
Parameters
- $arguments : array<string|int, mixed>|false
-
Can be changed to array for Php8.1+
matchFirstValue()
private
static matchFirstValue(array<string|int, mixed> $lookupArray, mixed $lookupValue) : int|string|null
Parameters
- $lookupArray : array<string|int, mixed>
- $lookupValue : mixed
Return values
int|string|nullmatchLargestValue()
private
static matchLargestValue(array<string|int, mixed> $lookupArray, mixed $lookupValue, array<string|int, mixed> $keySet) : mixed
Parameters
- $lookupArray : array<string|int, mixed>
- $lookupValue : mixed
- $keySet : array<string|int, mixed>
matchSmallestValue()
private
static matchSmallestValue(array<string|int, mixed> $lookupArray, mixed $lookupValue) : int|string|null
Parameters
- $lookupArray : array<string|int, mixed>
- $lookupValue : mixed
Return values
int|string|nullprepareLookupArray()
private
static prepareLookupArray(array<string|int, mixed> $lookupArray, mixed $matchType) : array<string|int, mixed>
Parameters
- $lookupArray : array<string|int, mixed>
- $matchType : mixed
Return values
array<string|int, mixed>testFalse()
private
static testFalse(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidateLookupArray()
private
static validateLookupArray(array<string|int, mixed> $lookupArray) : void
Parameters
- $lookupArray : array<string|int, mixed>
validateLookupValue()
private
static validateLookupValue(mixed $lookupValue) : void
Parameters
- $lookupValue : mixed
validateMatchType()
private
static validateMatchType(mixed $matchType) : int
Parameters
- $matchType : mixed