Formula Engine Reference Guide
 

 

Back to Class Index

 

MATCH(V, R[, T])

Description
This function returns the relative position of the value V in the range R, according to the rule specified by T:

1 find largest value in R <= V
0 or omitted find first value in R = V
-1 find smallest value in R = V

V can be a string or a numeric value. If V is a string, T must be 0 or omitted. If V is a string, it may contain the wildcard characters, asterisk () and question mark (?), to represent any sequence of characters and any single character respectively.

 

Parameters
V

Value to be matched

 

R
Range in which to match V

 

T
Type of match

 

Examples

0 A B

Products   Quantity (Boxes)
Apple            32
Orange          50
Cherry           15
Banana         20
Cantaloupe    10
Strawberry     25

MATCH(15, B1..B7) = 3

 

MATCH(30, B1..B7, 1) = 6

 

MATCH(30, B1..B7, -1) = 1

 

MATCH("Orange", A1..A7) = 2

 

MATCH("Can", A1..A7) = 5