|
ExcelWriter supports almost all major math, string, boolean, time, statistical, database, lookup and reference formulas or functions that are part of Excel. With ExcelWriter, formulas cannot be executed server-side to retrieve values for use in the script. All formulas are executed at the time that the file is downloaded and opened in Excel. (Please note: If the downloaded files are opened client side with the free Microsoft Excel Viewer, all formulas will be rendered with "0" as the resultant value.) Formulas can be inserted into any cell in a worksheet by using the
Cell.Formula
property. They can be inserted either by hard coding the cell address or by dynamic
coding using a variable, such as When applying a formula to a cell, always include the entire string in double quotation marks ("") and begin the string with an equal sign (=), as you would when creating a Microsoft Excel spreadsheet. Any formula that is not mentioned in this list can be inserted into an existing spreadsheet or template and used in ExcelWriter. This list is comprised of formulas that can be added into your ExcelWriter script to be included at run-time. The following example demonstrates using a formula.
ws.Cells("b6").Formula = "=sum(b2:b3)"
ExcelWriter 2 allows you to use values from a different sheet when assigning a formula to a cell, as in the following examples. ws3.Cells(1,1).Formula = "=sum(sheet1!A1,Sheet2!A2)" ws3.Cells(2,1).Formula = "=sum(sheet1!A1:A3)" Note that ExcelWriter does not support the following formulations:
ExcelWriter Supported Functions
Note: Microsoft Excel 2000 Help was consulted in preparing "Formula Functions" and its subsections.
Copyright © 2005, SoftArtisans, Inc. |
|||||||||||||||