Direct entry of a formula

As an alternative to using the DeltaV Reporter worksheet function dialogs,  you can enter the formula for a worksheet function directly into a cell in an Excel worksheet. The following sections provide procedures for entering a formula directly, including a tip about how to use a cell reference to enter a large number of columns when the number of characters in the formula exceeds length limitations imposed by Excel.

When entering a formula directly, first select a single cell or an appropriately dimensioned array of cells for the expected results. Press Enter for a single cell formula; press Ctrl+Shift+Enter for an array formula. In the case of an array formula, Excel encloses the formula in braces, { }, in the formula bar to indicate that it is an array formula.

To type a formula to enter a single historical value into a worksheet

  1. Select a single cell.
  2. Click F2 to edit the cell contents.
  3. Type  =functionname(arg1, ...)   

For example:

=DvCHValue("localhost","FIC-101.PV",FALSE,"Value","Local",0,"10/15/04 11:30:45 AM") 

  1. Press Enter.

The Continuous Historian database is queried and the cell shows the results of the formula calculated with the supplied arguments.

To type a formula to enter an array of historical data into a worksheet

  1. Select an appropriately dimensioned range of cells.
  2. Click F2 to edit the cell contents.
  3. Type  =functionname(arg1,...)    

For example, in a 1R x 2C range, type:

=DvCHIntervals("localhost","FIC-101.PV",FALSE,"Minimum Value;Minimum Timestamp","Local","10/15/04 2:15:00 PM","10/16/04 2:15:00 PM","30minutes") 

  1. Press Ctrl+Shift+Enter. 

Note  The formula as displayed in the formula bar is enclosed in braces, { }. This is Excel's indication that it is an array formula.

 It may be necessary to resize the column width to present the data more clearly.

Note that any formula you enter using these techniques can still be edited using the appropriate worksheet function dialog (invoked using the Edit Function menu option). This can be a useful way to set the correct range for your formula, using the dialog's "Adjust selection to accommodate results (if necessary)" option.

Using a Cell Reference for Columns

When entering an array formula, if you are using a large number of columns, it may be useful to enter the columns argument into another cell and then refer to the cell (for example, A1) in the formula text instead of typing all the column names directly into the formula. It may be necessary to do this, because Excel imposes various limits on the length of formulas and array functions.

Hint  To eliminate the need to type all the columns into the reference cell, you can choose the option to Insert the formula as text and then copy and paste the column names into the reference cell. Then you can create a new formula with one column and substitute the reference cell name (such as A1, without quotation marks) for the column name.

To use a cell reference for a large number of columns

  1. Type the columns argument (without quotation marks) into a cell, such as A1. Use semicolons to separate the column names. (Alternatively, you can use the hint above to create a cell containing the column names).
  2. Create a new formula using the worksheet function dialog and selecting just one column for inclusion. Select an array large enough to hold the results.
  3. Edit the formula text to refer to the cell (for example, A1, without quotation marks) that contains the full list of column names in place of the single column name.
  4. Press Ctrl+Shift+Enter to indicate that it is an array formula.

If you used a cell reference for the columns, the columns will show correctly in the configure dialog if you select Edit Function. As long as you don't actually edit the columns, clicking OK in the configure dialog will cause the modified function to be inserted still using the cell reference.

For more information about worksheet functions, refer to Using the Worksheet Function Dialogs in Books Online.