Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.8.1
ASP/COM Platform

View Docs for Another
Version or Platform

Programmer's Reference > ExcelApplication > Formula Calculation Operators

ExcelApplication is not
available in ExcelWriterSE.

Formula Calculation Operators

ExcelWriter supports all but two* Microsoft Excel operators. Use operators to perform calculations on formula elements.

Examples:

  • The following SUMIF formula includes the Range operator (:), the Union operator (,), and the Greater Than operator (>).

    ws.cells("B5").formula = "=SUMIF(A1:A4,'>44',B1:B4)"
    
  • The following PV formula includes the Division operator (/), the Union operator (,), and the Multiplication operator (*).

    ws.cells("B2").formula = "=PV(0.08/12,12*25,1000,0,1)"
    

* ExcelWriter does not support,

  • The Percent operator (%)
  • The Intersection operator (single space)
Reference Operators

Range operator

: (colon)

Creates a reference to the range of cells between two cell references. The range includes the two cells.

Example: A1:C12

Union operator

, (comma)

Creates a single reference or value from two or more references and/or values.

Example: SUMIF(A1:A4,'>44',B1:B4)

Comparison Operators

Equal to

= (equal sign)

The Equal to operator produces TRUE if the values compared are equal and FALSE if they are not.

Example: C2=D5

Greater than

> (greater than sign)

The Greater than operator produces TRUE if the first value is greater than the second and FALSE if it is not.

Example: C2>D5

Less than

< (less than sign)

The Less than operator produces TRUE if the first value is less than the second and FALSE if it is not.

Example: C2<D5

Greater than or equal to

>= (greater than or equal to sign)

The Greater than or equal to operator produces TRUE if the first value is greater than or equal to the second and FALSE if it is not.

Example: C2>=D5

Less than or equal to

<= (less than or equal to sign)

The Less than or equal to operator produces TRUE if the first value is less than or equal to the second and FALSE if it is not.

Example: C2<=D5

Not equal to

<> (not equal to sign)

The Not equal to operator produces TRUE if the compared values are not equal and FALSE if the compared values are equal.

Example: C2<>D5

Arithmetic operators

Addition

+ (plus sign)

Example: 8+2

Subtraction, Negation

- (minus sign)

Examples: 12-2, -1

Multiplication

* (asterisk)

Example: 5*7

Division

/ (forward slash)

Example: 9/3

Exponentiation

^ (caret)

Example: 2^3

Text Operator

Concatenation

& (ampersand)

Concatenates two strings.

Example: The result of ="jelly"&"bean" is "jellybean."

Note: Microsoft Excel 2000 Help was consulted in preparing "Formula Calculation Operators."



Copyright 2007 © SoftArtisans, Inc. All Rights Reserved.