How to Enter Constant Values


Constant values are data that is not calculated or evaluated. That is, Formula One for Java does not change the number or text you enter. However, sometimes the way you enter a constant value makes Formula One for Java interpret that value in a certain way. This is because of number formats.

Number formats are patterns that Formula One for Java uses for displaying numbers. A date format, for example, might require Formula One for Java to display the data as 3 sets of 2 numbers divided by slashes. Any date with that format follows that pattern. For more information on number formats, see About Number Formats.

Formula One for Java automatically applies some of its built-in number formats based on how you enter the constant value. The following sections describe how to enter different types of constant values to get the results you want.

Numbers as Constant Values

Numeric entries can (of course) contain the numeric characters 1, 2, 3, 4, 5, 6, 7, 8, 9, and 0. They can also contain commas to separate thousands, periods for decimal points, and the following special characters: +, -, (, ), /, $, %, E, and e.

Dates and Times as Constant Values

Formula One for Java automatically recognizes numeric entries that use slashes, hyphens, certain text strings, and colons as dates and times. When you enter a date or time as a value in a cell, Formula One for Java automatically applies a date or time format to that value.

Formula One for Java automatically recognizes data entered in the following ways as dates and/or times and applies the indicated format to that data.

Entered Format Assigned
3/15/94 mm/dd/yy
15-Mar-94 d-mmm-yy
15-Mar d-mmm
Mar-94 mmm-yy
9:55 PM h:mm AM/PM
9:55:33 PM h:mm:ss AM/PM
21:55 h:mm
21:55:33 h:mm:ss
3/15/94 21:55 mm/dd/yy h:mm

Text as Constant Values

Text is any set of characters that Formula One for Java does not recognize as a number, date, or time.

Text that is wider than a cell ordinarily spills over into the cell immediately to the right, if that cell is empty. You can specify that text should wrap within the cell by enabling word wrap in your alignment format settings. For information, see Aligning Cell Data.

If you want numbers to be treated as text in a worksheet, precede the number with a tick mark (').

Logical and Error Values as Constant Values

Logical values are the words TRUE and FALSE. Error values are messages Formula One for Java gives you when a formula you entered can't be computed. For a list of the error messages and what they mean, see Understanding Worksheet Errors.

Logical and error values are usually not entered directly in cells; they are usually the result of a formula. However, entering these values can be useful for testing formulas.