Search notes:

Excel formulas

An Excel formula starts with an equal sign (=), a plus (+) or a minus (-).
However, simple numbers such as +42 or -99.9 are not considered to be formulas, additional terms are required (for example +4*2-1).
A formula contains a combination of
Formulas can be entered or edited in the formula bar.
The so-called formula palette is a tool that provides information about functions and their arguments and thus helps with editing or creating formulas

Display formula text

Switch between formula text mode and formula result mode

ctrl+` (gravis) switches between displaying formula-text and formula-result.
If in show formula text mode, the resulting value of a specific formula can be shown by pressing F2 on the cell with the formula.
See also the DisplayFormulas property of the WorksheetView object.

Worksheet function formulaText

The worksheet function formulaText(ref) returns the formula in the cell ref. If there is no formula, it evaluates to #NA.

Evaluation modes

Excel evaluates formulas in one of two modes:
These modes differed how a function that expects a single value was passed a multi celled range (for example C42:C90).
Before Excel intruduced dynamic arrays (DA),
With the introduction of dynamic arrays, AE has become the default evaluation mode.
In Excel's object model, an AE formula is read/written with range.formula2. For backward compatiblity, a formula can be forced to behave in IIE mode (implicit intersection, no spilling) with range.formula2.

Operators

Range operator

The range operator is the colon. It produces a range with the cells between the addresses on its left and right side.
TODO: application.range seems to correspond to the colon operator.

Intersect operator

The intersect operator is a space. It evaluates to the range that is common to both ranges on its left and right side.
Thus, It is possible to write formulas such as the following which calculates the sum of the number in F10:F12
=sum(F9:F12 F10:F15)
An intersection that returns an empty set is shown with the #NULL! cell error.
See also the set operators in the application object.

Union operator

The union operator is the comma. It evaluates to the range that is present on any of the ranges on its left or right side.

Recalculation

Excel recalculates formulas either automatically, manually or automatically except for data tables.
This mode of recalculation can be changed in File -> Options -> Formulas -> Calculation options.
All currently open workbooks and worksheets share the same recalculation mode.
If the recalculation mode was not manually changed, then it determined by the recalculation mode of the first opened Worksheet.

Triggering recalculation

Formulas can be forced to be recalculated with Keyboard shortcuts involving F9:
Shortcut Description VBA equivalent
F9 calculates all worksheets in all open workbooks
shift+F9 calculates the active worksheet activeSheet.calculate (?)
ctrl+alt+F9 forces the recalculation in all worksheets of open workbooks, even if Excel thinks they have not changed application.calculateFullRebuild (?)
ctr+alt+shift+F9 calculates dependent cells

VBA functions

Additional VBA functions (that might be related to these keyboard shortcuts) are:
The corresponding VBA method is calculate (on a Worksheet object).
See also the calculation property of the application object.

Worksheet functions

The worksheet function info("recalc") evaluates to the current mode of recalculation.

See also

With VBA, it is possible to dynamically evaluate a formula with application.evaluate(formula)
Array formulas
The worksheet function isFormula()
Circular references
The (VBA) function application.convertFormula() converts range addresses of formulas between the two reference styles A1/R1C1 and/or between relative and absolute addresses.
Commands or tabs on the Ribbon that are related to formulas include
Using formulas for conditional formatting (Home -> Styles -> Conditional Formatting -> New Rule)
The VBA function range.clearContents
The window.displayFormulas property controls if a window's cells display formulas or their calculated values.
The Formula bar
The workbook.breakLink() method converts formulas that refer to other workbooks to values.
Cells that contain formulas can be found using range.specialCells and the xlCellTypeFormulas member of the xlCellType enumeration.

Index