Skip to content

Formula Types

Jahav edited this page Sep 3, 2022 · 2 revisions

Formula takes values and transform them to other values. There is only a limited number of types for the value.

List of types

Each value in a formula evaluation has one of following types:

  • blank - A value of an empty cell or a missing argument of a function. Empty string is not blank!, it is basically a missing value type.
  • logical - a bool value with either true or false value.
  • number - a double precision floating point number
  • text - a text of any length, even empty string.
  • error - one of standard excel errors, like #DIV/0!.
  • array - a 1D/2D array where each element is a logical/number/text/error value. Array has always at least 1 element.
  • reference - A reference to a cells of a workbook. Reference always has at least one cell. A reference is composed of one or more areas. Area is a continuous rectangular range of cells. Area can have associated workbook, but that is optional (A1:B2 will be turned into an area without a workbook). If the workbook is needed and not present, the context workbook is used.

There is no type for TimeSpan or DateTime. Both are represented by a number.

Type coercion

If a type is not suitable, CalcEngine can coerce convert value of a type to a different type. Not all conversions are possible, failed conversion will create the #VALUE! error.

Some conversions are dependent on a culture, e.g. text "1,25" can be converted to a number 1.25 in Czech culture but fails with #VALUE! with US culture.

A1 is a blank cell. N/A means conversion is not available, thus result is #VALUE!

Conversion from a value to blank value is not possible, so it is omitted from conversion table.

Conversion table is a work in progress

From\To logical number text error array reference
blank false 1.0 empty string N/A N/A N/A
IF(A1,"blank is true", "false") COS(A1) results into 1, which means the value of COS was 0 IF(A1="",1,2) is 1
number 0 is false, other numbers are true identity convert number to text using culture N/A N/A N/A
text
error
array
reference

FAQ

Examples

Real world scenarios

Time Savers

Performance and Memory

Misc

Inserting Data/Tables

Styles

Ranges

Rows

Columns

Page Setup (Print Options)

AutoFilters

Comments

Dev docs

Clone this wiki locally