Spreadsheet Formulas - Examples

The following table illustrates examples of Statistica spreadsheet formulas:

Formula

Result

=(Measur1+Measur2+Measur3)/3

This formula will compute the average of three variables.

=(v0<=10)*1+(v0>10)*2

This formula will recode cases 1-10 as 1, and the rest as 2. Note that a logical expression evaluates to 1 if it is true and to 0 if it is false.

=((v1=1) AND (v2=5))*5

This formula returns the value of 5 if v1=1 and v2=5, and 0 otherwise. Note that a logical expression evaluates to 1 if it is true and to 0 if it is false.

=(((v1=1)OR(v2=5))<>0)*5

This formula returns the value of 5 if either or both conditions hold, and 0 otherwise. Note that a logical expression evaluates to 1 if it is true and to 0 if it is false.

=student(v4,15)

This formula returns probability density values of the Student's t distribution based on the values of v4 and 15 degrees of freedom.

=trunc((v0-1)/10)

This formula assigns consecutive integers to the consecutive sets of 10 cases (i.e., cases number 1 through 10 will be assigned 0, cases number 11-20 will be assigned 1, and so on.

=(V1 - VARMEAN(V1))/VARSTDDEV(V1)

This formula returns the normalized values for variable 1.

See also: Spreadsheet Formulas - Overview, Spreadsheet Formulas - Syntax Summary.