pub struct IndirectFn;Trait Implementations§
Source§impl Debug for IndirectFn
impl Debug for IndirectFn
Source§impl Function for IndirectFn
Converts text into a reference and returns the referenced value or range.
impl Function for IndirectFn
Converts text into a reference and returns the referenced value or range.
INDIRECT lets formulas build references dynamically from strings such as "A1" or
"Sheet2!B3:C5".
§Remarks
a1_styledefaults toTRUE(A1 style parsing).a1_style=FALSE(R1C1 parsing) is currently not implemented and returns#N/IMPL!.- Invalid or unresolved references return
#REF!. - The function is volatile because target references can change without direct dependency links.
§Examples
title: "Resolve a direct cell reference"
grid:
A1: 99
formula: '=INDIRECT("A1")'
expected: 99title: "Resolve a range and aggregate it"
grid:
A1: 5
A2: 7
A3: 9
formula: '=SUM(INDIRECT("A1:A3"))'
expected: 21related:
- ADDRESS
- INDEX
- OFFSET
faq:
- q: "What happens if a1_style is FALSE?"
a: "R1C1 parsing is not implemented here yet, so INDIRECT(...,FALSE) returns #N/IMPL!."
- q: "How are bad reference strings reported?"
a: "If the text cannot be parsed or resolved to a valid reference, INDIRECT returns #REF!."[formualizer-docgen:schema:start] Name: INDIRECT Type: IndirectFn Min args: 1 Max args: 2 Variadic: false Signature: INDIRECT(arg1: text@scalar, arg2?: logical|number@scalar) Arg schema: arg1{kinds=text,required=true,shape=scalar,by_ref=false,coercion=None,max=None,repeating=None,default=false}; arg2{kinds=logical|number,required=false,shape=scalar,by_ref=false,coercion=Logical,max=None,repeating=None,default=true} Caps: PURE, VOLATILE, RETURNS_REFERENCE, DYNAMIC_DEPENDENCY [formualizer-docgen:schema:end]
fn name(&self) -> &'static str
fn min_args(&self) -> usize
fn arg_schema(&self) -> &'static [ArgSchema]
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>>
Optional reference result path. Only called by the interpreter/engine
when the callsite expects a reference (e.g., range combinators, by-ref
argument positions, or spill sources). Read more
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>
The unified evaluation path. Read more
fn namespace(&self) -> &'static str
fn variadic(&self) -> bool
fn volatile(&self) -> bool
Source§fn aliases(&self) -> &'static [&'static str]
fn aliases(&self) -> &'static [&'static str]
Optional list of additional alias names (case-insensitive) that should resolve to this
function. Default: empty slice. Implementors can override to expose legacy names.
Returned slice must have ’static lifetime (typically a static array reference).
fn function_salt(&self) -> u64
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>
Dispatch to the unified evaluation path with automatic argument validation.
Auto Trait Implementations§
impl Freeze for IndirectFn
impl RefUnwindSafe for IndirectFn
impl Send for IndirectFn
impl Sync for IndirectFn
impl Unpin for IndirectFn
impl UnsafeUnpin for IndirectFn
impl UnwindSafe for IndirectFn
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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