pub struct RandArrayFn;Trait Implementations§
Source§impl Debug for RandArrayFn
impl Debug for RandArrayFn
Source§impl Function for RandArrayFn
Generates a random spilled array of numbers.
impl Function for RandArrayFn
Generates a random spilled array of numbers.
RANDARRAY can return decimal values or whole numbers in a specified range.
§Remarks
- Defaults:
rows=1,columns=1,min=0,max=1,whole_number=FALSE. - The function is non-deterministic and recalculates to new values.
- For whole numbers, values are generated in an inclusive integer range.
rows <= 0,columns <= 0, or invalid integer bounds return#VALUE!.
§Examples
title: "Generate a 2x3 decimal matrix"
formula: '=RANDARRAY(2,3)'
expected: "2x3 array of decimals in [0,1)"title: "Generate six integer dice rolls"
formula: '=RANDARRAY(6,1,1,6,TRUE)'
expected: "6x1 array of integers from 1 to 6"related:
- SEQUENCE
- SORT
- UNIQUE
faq:
- q: "Are RANDARRAY bounds inclusive?"
a: "In whole_number mode, min and max are inclusive integer bounds; in decimal mode values are generated over the numeric interval from min toward max."
- q: "Why does RANDARRAY recalculate on every recalc pass?"
a: "RANDARRAY is volatile and non-deterministic by design, so its spilled results are regenerated each evaluation."[formualizer-docgen:schema:start] Name: RANDARRAY Type: RandArrayFn Min args: 0 Max args: variadic Variadic: true Signature: RANDARRAY(arg1?: number@scalar, arg2?: number@scalar, arg3?: number@scalar, arg4?: number@scalar, arg5?…: logical@scalar) Arg schema: arg1{kinds=number,required=false,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=true}; arg2{kinds=number,required=false,shape=scalar,by_ref=false,coercion=NumberLenientText,max=None,repeating=None,default=true}; 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}; arg5{kinds=logical,required=false,shape=scalar,by_ref=false,coercion=Logical,max=None,repeating=None,default=true} Caps: none [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 RandArrayFn
impl RefUnwindSafe for RandArrayFn
impl Send for RandArrayFn
impl Sync for RandArrayFn
impl Unpin for RandArrayFn
impl UnsafeUnpin for RandArrayFn
impl UnwindSafe for RandArrayFn
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