Contents
- Index
- Previous
- Next
Formula property
Applies to
TProfGridCell class
Declaration
property Formula: WideString;
Description
Specifies a formula for the cell.
Cell references, arithmetic operations, and syntax rules in formulae are identical to Microsoft Excel ones. The supported functions are identical to Microsoft Excel functions. You may use the Microsoft Excel help system as a reference on formulae and functions.
When you reference grid cells in formulae, use the Excel-style "A1"-notation. Using the "A1"-notation, note that the grid index of "Column A" is equal to Ord(SpreadsheetHeaders). The same is true for grid index of "Row 1" in formulae: "Row 1" is Ord(SpreadsheetHeaders). In other words, cell "A1" is AbsoluteCells[1,1] if you use spreadsheet headers, or AbsoluteCells[0,0] if you don't use spreadsheet headers.
Tip: The Formula property does not contain and must not contain the leading '=' (equal sign). The leading '=' appears only in edit mode and must be typed only in edit mode.
Note: The expression parser takes into account the values of DecimalSeparator and ListSeparator global variables.
Example
ProfGrid1.CellByName('A11').Formula := 'SUM(A1:A10)';
ProfGrid1.CellByName('A12').Formula := 'AVERAGE(A1:A10)';
ProfGrid1.CellByName('A13').Formula := 'COUNT(A1:A10)';
ProfGrid1.CellByName('A14').Formula := 'MIN(A1:A10)';
ProfGrid1.CellByName('A15').Formula := 'MAX(A1:A10)';
Currently supported spreadsheet functions
ABS
ACOS
ACOSH
AND
ASIN
ASINH
ATAN
ATAN2
ATANH
AVERAGE
CEILING
CHAR
CHOOSE
CLEAN
CODE
COMBIN
CONCATENATE
CORREL
COS
COSH
COUNT
COUNTA
COUNTBLANK
COUNTIF
COVAR
DATE
DATEDIF
DATEVALUE
DAY
DEGREES
DOLLAR
EDATE
EOMONTH
EVEN
EXACT
EXP
FACT
FACTDOUBLE
FALSE
FIND
FIXED
FLOOR
GCD
HOUR
IF
INT
INTERCEPT
ISBLANK
ISERR
ISERROR
ISLOGICAL
ISNA
ISNONTEXT
ISNUMBER
ISTEXT
LARGE
LCM
LEFT
LEN
LN
LOG
LOG10
LOOKUP
LOWER
MAX
MEDIAN
MID
MIN
MINUTE
MOD
MONTH
MROUND
MULTINOMIAL
N
NA
NOT
NOW
ODD
OR
PI
POWER
PRODUCT
PROPER
QUOTIENT
RADIANS
RAND
RANDBETWEEN
REPLACE
REPT
RIGHT
ROUND
ROUNDDOWN
ROUNDUP
SECOND
SIGN
SIN
SINH
SLOPE
SMALL
SQRT
SQRTPI
STDEV
STDEVP
SUBSTITUTE
SUM
SUMIF
SUMSQ
T
TAN
TANH
TEXT
TIME
TIMEVALUE
TODAY
TRIM
TRUE
TRUNC
UPPER
VALUE
VAR
VARP
WEEKDAY
YEAR
YEN