Entering Data: Entering Formulas

To Enter/Edit a Formula

Enter a desired expression, including the leading "=".
For example, to sum A1, A2 and A3 and place the result in A4, enter in the A4 cell:

=A1 + A2 + A3
or
=sum(A1:A3)

To count numbers greater than 2 in the range A1:A100 and place the result in B4, enter in the B4 cell:

=countIf(A1:A100, ">2")

Other examples:

="abc"
={1, 2, 3; "abc", " 'def' ", ' "ghi" '}
=1 + 2
="a" & 'b' & 3
=fv(0.75%, 36, -500, -5500, 0)
=LProg({2,2;1,2;4,0}, {1;1;1}, {14;8;16}, {2; 4},0,,)
=sum(a1:b2, c3, 5:5, 10, sum(20, 30, 40))
=sum(A1:B2, C3, E:E, 10, sum(20, 30, 40))
=index(timeSeries($A$1:$A$100, 3, 10, 0.9), , 1)

Numbers used as arguments cannot be formatted. For example, the expression =$1,000.00 + 1 is invalid. Text strings should be delimited by either single or double quotation marks.

Note: Even if Settings > Options > Calculations > Automatic update mode is OFF, it's typically sufficient just to enter a given formula to display its up-to-date value.
The exceptions are formulas referring to functions that perform searching or filtering, and the "...If" actions that require internal cell sorting and can cause some delays. In this case, if automatic update mode is OFF, you have to run one of the Tools > Update commands to obtain the current value of that formula after you enter or edit it.

Formulas can contain circular references. For example, if cell A1 contains '=B2 + 1', B2 contains '=C3 + 1' and C3 contains '=A1', then each time you update the workbook, GS-Calc will perform recursive/circular recalculation for those three cells. The number of such circular updates depends on the Recursion level parameter specified in the Options dialog box. Possible values are from 1 to 255.
Circular cell markers are displayed if that level is 2 or higher. To list all formulas with circular references, use the Find All > Circular Formulas command on the Find toolbar.

To browse all available formula categories and examples, use the List Of Formulas dialog box, which is displayed when editing formulas or after clicking the Formula edit field on the toolbar.

Note: Square brackets [,] in parameter lists denote parameters that are optional and can be omitted. For example:
LProg(A, s, b, c, vector, [epsilon], [m])

If your system settings use commas as decimal separators, use semicolons (;) to separate function arguments, or, if you prefer locale-independent (US) settings, select the generic locale via the Settings > Locales > Generic command.

Available operators:

OperatorOperationCommentsPrecedence
=EqualCompares numbers or text strings (the comparison is not case-sensitive).
Example: A1=4 , B2="abc"
9
<Less thanCompares numbers or text strings (the comparison is not case-sensitive).
Example: A1<4 , B2<"abc"
9
>Greater thanCompares numbers or text strings (the comparison is not case-sensitive).
Example: A1>4 , B2>"abc"
9
<=Less than or equalCompares numbers or text strings (the comparison is not case-sensitive).
Example: A1<=4 , B2<="abc"
9
>=Greater than or equalCompares numbers or text strings (the comparison is not case-sensitive).
Example: A1>=4 , B2>="abc"
9
<>Not equalCompares numbers or text strings (the comparison is not case-sensitive).
Example: A1<>4 , B2<>"abc"
9
+AdditionAdds numbers.8
-SubtractionSubtracts numbers.8
&String concatenationMerges text strings.
Example: A1 & "abc" , "a" & "b"
8
*MultiplicationMultiplies numbers.7
/DivisionDivides numbers.7
^To the power ofCalculates the power of.6
-NegativeChanges the sign of a number.
Example: -A1
5
%PercentSpecifies a number entered as a percentage.
Example: 12%
4
_IntersectionSpecifies a (reference to an) intersection of two ranges.
Example: 5:5_b:b , a1:a5_a5:a8
3
!Worksheet referenceSpecifies a reference to another worksheet/folder.
Example: sheet2!(5:5_b:b)
2
:Range of cellsCreates a range.
Example: r1c1:r5c5 , A1:B5
1

To Recalculate Formulas

By default, changing any cell's contents updates all formulas and charts in all worksheets. Use the Tools > Automatic Updating command to turn automatic updating on or off.

To Count Formulas Entered Within the Current Selection, in the Current Worksheet, or in the Entire Document

Use the File > Statistics command.

To Find a Sum, Min/Max/Mean Value, etc. of a Given Range of Cells

Select that range. The sum, minimum, maximum and mean values are displayed in the second status bar pane.

or

  1. Select a cell range as shown below:
    Selecting a cell range to view its summary statistics
  2. Click the Formula button on the toolbar and choose the desired function.