pub struct XMatchFn;Trait Implementations§
Source§impl Function for XMatchFn
Returns the 1-based position of a value in a one-dimensional lookup array.
impl Function for XMatchFn
Returns the 1-based position of a value in a one-dimensional lookup array.
XMATCH extends MATCH with explicit search direction and wildcard mode.
§Remarks
- Defaults:
match_mode=0(exact),search_mode=1(first-to-last). match_mode:0exact,-1exact-or-next-smaller,1exact-or-next-larger,2wildcard.search_mode:1forward,-1reverse,2ascending binary intent,-2descending binary intent.lookup_arraymust be a single row or single column, otherwise returns#VALUE!.- Not found returns
#N/A.
§Examples
title: "Exact match position"
grid:
A1: "alpha"
A2: "beta"
A3: "gamma"
formula: '=XMATCH("beta",A1:A3)'
expected: 2title: "Reverse search finds last duplicate"
grid:
A1: 7
A2: 9
A3: 7
formula: '=XMATCH(7,A1:A3,0,-1)'
expected: 3related:
- XLOOKUP
- MATCH
- INDEX
faq:
- q: "How do search_mode values affect duplicate matches?"
a: "search_mode=1 returns the first qualifying match, while search_mode=-1 scans from the end and returns the last qualifying match."
- q: "When do binary-intent search modes (2 or -2) return #N/A?"
a: "For approximate modes they require sorted data in the expected direction; unsorted arrays are treated as no valid match and return #N/A."[formualizer-docgen:schema:start] Name: XMATCH Type: XMatchFn Min args: 2 Max args: variadic Variadic: true Signature: XMATCH(arg1: any@scalar, arg2: range@range, arg3?: number@scalar, arg4?…: number@scalar) Arg schema: arg1{kinds=any,required=true,shape=scalar,by_ref=false,coercion=None,max=None,repeating=None,default=false}; arg2{kinds=range,required=true,shape=range,by_ref=true,coercion=None,max=None,repeating=None,default=false}; arg3{kinds=number,required=false,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=true}; arg4{kinds=number,required=false,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=true} Caps: PURE, LOOKUP [formualizer-docgen:schema:end]
fn name(&self) -> &'static str
fn min_args(&self) -> usize
fn variadic(&self) -> bool
fn arg_schema(&self) -> &'static [ArgSchema]
Source§fn eval<'a, 'b, 'c>(
&self,
args: &'c [ArgumentHandle<'a, 'b>],
_ctx: &dyn FunctionContext<'b>,
) -> Result<CalcValue<'b>, ExcelError>
fn eval<'a, 'b, 'c>( &self, args: &'c [ArgumentHandle<'a, 'b>], _ctx: &dyn FunctionContext<'b>, ) -> Result<CalcValue<'b>, ExcelError>
fn namespace(&self) -> &'static str
fn volatile(&self) -> bool
Source§fn aliases(&self) -> &'static [&'static str]
fn aliases(&self) -> &'static [&'static str]
fn function_salt(&self) -> u64
Source§fn eval_reference<'a, 'b, 'c>(
&self,
_args: &'c [ArgumentHandle<'a, 'b>],
_ctx: &dyn FunctionContext<'b>,
) -> Option<Result<ReferenceType, ExcelError>>
fn eval_reference<'a, 'b, 'c>( &self, _args: &'c [ArgumentHandle<'a, 'b>], _ctx: &dyn FunctionContext<'b>, ) -> Option<Result<ReferenceType, ExcelError>>
Source§fn dispatch<'a, 'b, 'c>(
&self,
args: &'c [ArgumentHandle<'a, 'b>],
ctx: &dyn FunctionContext<'b>,
) -> Result<CalcValue<'b>, ExcelError>
fn dispatch<'a, 'b, 'c>( &self, args: &'c [ArgumentHandle<'a, 'b>], ctx: &dyn FunctionContext<'b>, ) -> Result<CalcValue<'b>, ExcelError>
Auto Trait Implementations§
impl Freeze for XMatchFn
impl RefUnwindSafe for XMatchFn
impl Send for XMatchFn
impl Sync for XMatchFn
impl Unpin for XMatchFn
impl UnsafeUnpin for XMatchFn
impl UnwindSafe for XMatchFn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more