Table of Contents

TFormulaValue Record

Represents a value inside a formula. it might be an array of values in case it is an array formula.

Syntax

Unit: FlexCel.Core

TFormulaValue = record;

Methods

Name Description
AsArray Returns the formula result as an array of values if the formula contains an array. If the formula result is not an array, this method will throw an exception.
AsAverage Returns the value of the formula if it contains an average. If it contains other datatype, this method will throw an exception.



Check IsAverage to see if the formula contains an average.


AsBoolean Returns the value of the formula if it contains a boolean. If it contains other datatype, this method will throw an exception.



Check IsBoolean to see if the formula contains a boolean.


AsCellAddress Returns the value of the formula if it contains a cell adress. If it contains other datatype, this method will throw an exception.



Check IsCellAddress to see if the formula contains a cell address.


AsCellRange Returns the value of the formula if it contains a range of cells.
If it contains other datatype, this method will throw an exception.



Check IsCellRange to see if the formula contains a range of cells.


AsDateTime Returns the value of the formula if it contains a detetime. If it contains other datatype, this method will throw an exception.



Check IsDateTime to see if the formula contains a datetime.


AsError Returns the value of the formula if it contains an error. If it contains other datatype, this method will throw an exception.



Check IsError to see if the formula contains an error.


AsLambda Returns the value of the formula if it contains a a lambda. If it contains other datatype, this method will throw an exception.



Check IsLambda to see if the formula contains a lambda.


AsNumber Returns the value of the formula if it contains a number. If it contains other datatype, this method will throw an exception.



Check IsNumber to see if the formula contains a number.


AsRange3D Returns the value of the formula if it contains a range of cells covering many sheets. If it contains other datatype, this method will throw an exception.



Check IsRange3D to see if the formula contains a range of cells in multiple sheets.


AsString Returns the value of the formula if it contains a string. If it contains other datatype, this method will throw an exception.



Check IsString to see if the formula contains a string.


AsTValue Returns the formula result as a TValue.
AsVariant Returns the formula result as a variant.
Create Overloaded
Create(Double)
Create(Int64)
Create(TDateTime)
Create(string)
Create(Boolean)
Create(TFlxFormulaErrorValue)
Create(TFormulaValueArray2)
Create(TAddress)
Create(TSingleFormulaValue)
Create(TAverageValue)
Create(TArray<TAddress>, Boolean)
Create(Integer, Integer)
Create(TAddress, TAddress, Boolean)
Empty Creates a formula value without value.
FromLambda Creates a formula value containing a Lambda. Note that Lambdas are used internally only.
You shouldn't use this overload, and a public TFormulaValue should never contain a lambda.
GetLength Returns the length of any of the 2 possible dimensions of the array of TSingleFormulaValue
HasValue Returns true if the formula has a value. This method is the same as not IsEmpty
IsArray Returns true if the formula contains an array of values instead of a single value.
IsAverage Returns true if the formula contains an Average value. This value is used internally to calculate averages, formula results won't contain averages.
IsBoolean Returns true if the formula contains a boolean.
IsCellAddress Returns true if the formula has a TCellAddress
IsCellRange Returns true if the formula contains a range of cells.
IsDateTime Returns true if the formula has a datetime. Note that formulas by default never have datetimes, they have numbers instead.
IsEmpty Returns true if the formula is empty.
IsError Returns true if the formula contains an error.
IsLambda Returns true if the formula contains lambda function.
IsMissingArg Returns true if the value is a missing argument from a function, like in the formula =MyFunction(1, ,3) where the second parameter is missing.
IsNumber Returns true if the formula has a number.
IsRange3D Returns true if the formula contains a range of cells spanning more than one sheet.
IsString Returns true if the formula contains a string.
MissingArg Creates a formula value containing a missing argument.
ToString Converts the formula result to a string.
ToStringInvariant Converts the formula result to a string with invariant format. This means that for example the number 1.2 will be converted to the string '1.2' even if in the active locale it would '1,2' because the decimal separator is a comma. To get the number as a string in the current locale, use ToString
TryAsArray Will return the formula result if the formula result is an array, or nil if the formula result is something else.
TryAsCellAddress Will return the formula result if the formula result is a cell address, or nil if the formula result is something else.
TryToDouble Tries to convert this value to a number, and returns true is possible.

Operators

Properties

Name Description
ValueType Returns the type of value stored in the formula. (a string, a number etc). You can check for this directly or call the helper methods like IsNumber or IsBoolean. Those methods internally check for ValueType.