## Functions

When using a function in a formula, type the name of the function and supply the arguments required. For example, the Len function requires a String argument and computes the length of the string.

    Dim x As String
    x = "hello"
    formula = Len (x) 'The formula returns the Number 5

Supplying arguments of the incorrect type required by the function produces an error. For example, calling Len (3) would produce an error since Len does not accept a Number argument. Functions sometimes can accept different numbers of arguments or types of arguments. For example, the CDate function could accept a single String argument to form a Date value or 3 Number values holding the year, month and day respectively and form a Date value from them. See Date, Time, and DateTime.

##### Example with the Mid function

    Dim x as String
    x = "hello"
    'Start at position 2, go to the end of the string
    formula = Mid (x, 2) 'formula is now "ello"
    'Start at position 2, extract 1 character
    formula = Mid (x, 2, 1) 'formula is now "e"

The classes of functions are: Math, Summary, Financial, String, Date/Time, Date Range, Array, Type Conversion, Programming Shortcuts, Evaluation Time, Print State, Document Properties and Additional Functions. There are also some functions specific to conditional formatting formulas.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com