|
TWiki Spreadsheet Plugin
This Plugin adds speadsheet capabilities to TWiki topics. Formulae like %CALC{"$INT(7/3)"}% are evaluated at page view time. They can be placed in table cells and outside of tables. In other words, this Plugin provides general formula evaluation capability, not just classic spreadsheet functions.
|
|
SUM( list ) -- sum of a list or range of cells
- Syntax:
$SUM( list )
- Example: To sum up column 5 excluding the title row, write
%CALC{"$SUM(R2:C5..R$ROW(-1):C5)"}% in the last row; or simply %CALC{"$SUM($ABOVE())"}%
|
< < |
|
> > |
|
|
SUMDAYS( list ) -- sum the days in a list or range of cells
|
|
- Serialized date is seconds since the Epoch, e.g. midnight, 01 Jan 1970. Current time is taken if the date string is empty. Supported date formats:
31 Dec 2009 ; 31 Dec 2009 GMT ; 31 Dec 09 ; 31-Dec-2009 ; 31/Dec/2009 ; 2009/12/31 ; 2009-12-31 ; 2009/12/31 ; 2009/12/31 23:59 ; 2009/12/31 - 23:59 ; 2009-12-31-23-59 ; 2009/12/31 - 23:59:59 ; 2009.12.31.23.59.59 . Date is assumed to be server time; add GMT to indicate Greenwich time zone
- Syntax:
$TIME( text )
- Example:
%CALC{"$TIME(2003/10/14 GMT)"}% returns 1066089600
|
< < |
|
> > |
|
|
TIMEADD( serial, value, unit ) -- add a value to a serialized date
|
|
- The unit is seconds if not specified; unit can be specified as in
$TIMEADD() . Note: An approximation is used for month and year calculations. Use $FORMAT() or $INT() to format real numbers
- Syntax:
$TIMEDIFF( serial_1, serial_2, unit )
- Example:
%CALC{"$TIMEDIFF($TIME(), $EVAL($TIME()+90), minute)"}% returns 1.5
|
< < |
|
> > |
|
|
TODAY( ) -- serialized date of today at midnight GMT
|
|
- Example:
%CALC{"$VALUE(Total: -12.5)"}% returns -12.5
- Related:
$EVAL() , $INT()
|
> > |
WORKINGDAYS( serial_1, serial_2 ) -- working days between two serialized dates
- Working days are Monday through Friday (sorry, Israel!)
- Syntax:
$WORKINGDAYS( serial_1, serial_2 )
- Example:
%CALC{"$WORKINGDAYS($TIME(2004/07/15), $TIME(2004/08/03))"}% returns 13
- Related:
$SUMDAYS() , $TIME() , $TIMEDIFF()
|
|
Bug Tracking Example
|
|
Plugin Info
|
< < |
Plugin Version: | 24 May 2004 |
|
> > |
Plugin Version: | 17 Jul 2004 |
|
|
Change History: | <!-- specify latest version first --> |
|
> > |
|
|
24 May 2004: | Refactored documentation (no code changes) |
03 Apr 2004: | Added $ABS(), $LISTIF(); fixed $VALUE() to remove leading zeros; changed $FIND() and $SEARCH() to return 0 instead of empty string if no match |
21 Mar 2004: | Added $LISTITEM(); fixed call to unofficial function |
|
|
Related Topics: TWikiPreferences, TWikiPlugins
|
< < |
-- TWiki:Main/PeterThoeny - 24 May 2004
`
|
> > |
-- TWiki:Main/PeterThoeny - 17 Jul 2004
|
|
|