Page 412 - Excel for Scientists and Engineers: Numerical Methods
P. 412
Appendix 3
Custom Functions
Help File
MIndex
Returns a horizontal 2-element array containing the row and column numbers of a
specified value in an array.
Syntax
MI n d ex (kokup- wabe, array-, match- type)
lookup-value the value you use to find the value you want in array-
array- a contiguous range of cells containing possible lookup values
match-type the number -1, 0, or 1, that specifies the value found in array-
Remarks
The arguments lookup-value, array- and match-type can be either references or
names.
If match-type is 0 or omitted, returns the position of the value that is exactly equal
to lookup-value, or #N/A.
If match-type is 1, returns the position of the largest value that is less than or
equal to lookup-value.
If match-type is -1, returns the position of the smallest value that is greater than
or equal to lookup-value.
array- must contain only numbers. If any cells contain text or error values, MIndex
returns the #VALUE! error value. Empty cells are treated as zero.
The MIndex function is an array function. To return the array, you must select a
horizontal range of two cells, enter the function and then press
CONTROL+SHIFT+ENTER (Windows) or COMMAND+RETURN or
CONTROL+S Him+ RETU RN (Macintosh) .
Example
If the range A contains the values { 13,0,-1;5,12,22;-5,0,1}, the expression
MIndex(MAX(A),A) returns the values {2,3}; the expression MIndex(7,A) returns the
values {#N/A,#N/A}.
If the range 8 contains the values {2,11,-1;4,-1,7;-3,1,13}, the expression
MIndex(MIN(B),B) returns the values {3,1}; the expression MIndex(0,B-1) returns the
values {3,2).
3 89