Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## phpwiki-checkins

 [phpwiki-checkins] SF.net SVN: phpwiki:[6392] trunk/pgsrc/Help%2FSpreadsheet From: - 2009-01-11 17:47:57 ```Revision: 6392 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6392&view=rev Author: vargenau Date: 2009-01-11 17:47:52 +0000 (Sun, 11 Jan 2009) Log Message: ----------- Description of spreadsheet syntax in Wikicreole tables Added Paths: ----------- trunk/pgsrc/Help%2FSpreadsheet Added: trunk/pgsrc/Help%FSpreadsheet =================================================================== --- trunk/pgsrc/Help%2FSpreadsheet (rev 0) +++ trunk/pgsrc/Help%2FSpreadsheet 2009-01-11 17:47:52 UTC (rev 6392) @@ -0,0 +1,129 @@ +Date: Tue, 11 Jan 2009 8:18:24 +0100 +Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) +X-Rcs-Id: \$Id\$ +Content-Type: application/x-phpwiki; + pagename=Help%2FSpreadsheet; + flags=PAGE_LOCKED; + markup=2; + charset=iso-8859-1 +Content-Transfer-Encoding: binary + +Phpwiki has extented the [[Help:Wikicreole|Wikicreole]] syntax of tables so that some simple +spreadsheet-like calculations can be performed in tables. + +== Syntax == + +Five functions are available: SUM, AVERAGE, MAX, MIN and COUNT. + +They operate on the current row (R) or column (C). + +The function is placed in the cell surrounded by ##@@##. +Other wiki text can be placed in the cell, but there can be only one formula per cell. + +{| class="bordered" +|- +| Formula || Meaning +|- +| @@=SUM(R)@@ || Sum of cells in current row +|- +| @@=SUM(C)@@ || Sum of cells in current column +|- +| @@=AVERAGE(R)@@ || Average of cells in current row +|- +| @@=AVERAGE(C)@@ || Average of cells in current column +|- +| @@=MAX(R)@@ || Maximum value of cells in current row +|- +| @@=MAX(C)@@ || Maximum value of cells in current column +|- +| @@=MIN(R)@@ || Minimum value of cells in current row +|- +| @@=MIN(C)@@ || Minimum value of cells in current column +|- +| @@=COUNT(R)@@ +| Number of cells in current row (numeric or not, excluding headers and current cell) +|- +| @@=COUNT(C)@@ +| Number of cells in current column (numeric or not, excluding headers and current cell) +|} + +== Examples == + +=== Sum === + + +<< WikicreoleTable +|=Region |=Telecom Sales |=Power Sales |=Other |=TOTAL | +|=Europe | 320 | 80 | 120 |@@=SUM(R)@@ | +|=Asia | 580 | 723 | 564 |@@=SUM(R)@@ | +|=North America | 235 | 60 | 109 |@@=SUM(R)@@ | +|=South America | 120 | 35 | 82 |@@=SUM(R)@@ | +|=Antarctica | 0 | 0 | 12 |@@=SUM(R)@@ | +|=TOTAL | @@=SUM(C)@@ | @@=SUM(C)@@ | @@=SUM(C)@@ |Grand total: @@=SUM(R)@@ | +>> + + +<< WikicreoleTable +|=Region |=Telecom Sales |=Power Sales |=Other |=TOTAL | +|=Europe | 320 | 80 | 120 |@@=SUM(R)@@ | +|=Asia | 580 | 723 | 564 |@@=SUM(R)@@ | +|=North America | 235 | 60 | 109 |@@=SUM(R)@@ | +|=South America | 120 | 35 | 82 |@@=SUM(R)@@ | +|=Antarctica | 0 | 0 | 12 |@@=SUM(R)@@ | +|=TOTAL | @@=SUM(C)@@ | @@=SUM(C)@@ | @@=SUM(C)@@ |Grand total: @@=SUM(R)@@ | +>> + +Total of both colums and rows is calculated automatically by wiki. + +=== Count and Sum === + + +<< WikicreoleTable +|=Bug |=Priority |=Subject |=Status |=Days to fix +| 1231 | Low | File Open ... | Open | 3 +| 1232 | High | Memory Window ... | Fixed | 2 +| 1233 | Medium | Usability issue ... | Assigned | 5 +| 1234 | High | No arrange ... | Fixed | 1 +| Number of bugs: @@=COUNT(C)@@ | | | | Total: @@=SUM(C)@@ days +>> + + +<< WikicreoleTable +|=Bug |=Priority |=Subject |=Status |=Days to fix +| 1231 | Low | File Open ... | Open | 3 +| 1232 | High | Memory Window ... | Fixed | 2 +| 1233 | Medium | Usability issue ... | Assigned | 5 +| 1234 | High | No arrange ... | Fixed | 1 +| Number of bugs: @@=COUNT(C)@@ | | | | Total: @@=SUM(C)@@ days +>> + +=== Min, Max and Average === + + +<< WikicreoleTable +|=Location |=Morning |=Noon |=Evening |=Average temperature | +| Paris | 7 | 13 | 10 | @@=AVERAGE(R)@@ | +| London | 3 | 10 | 8 | @@=AVERAGE(R)@@ | +| Berlin | 9 | 15 | 12 | @@=AVERAGE(R)@@ | +| Tokyo | 12 | 20 | 16 | @@=AVERAGE(R)@@ | +| Maximum temperature | @@=MAX(C)@@ | @@=MAX(C)@@ | @@=MAX(C)@@ | | +| Minimum temperature | @@=MIN(C)@@ | @@=MIN(C)@@ | @@=MIN(C)@@ | | +>> + + +<< WikicreoleTable +|=Location |=Morning |=Noon |=Evening |=Average temperature | +| Paris | 7 | 13 | 10 | @@=AVERAGE(R)@@ | +| London | 3 | 10 | 8 | @@=AVERAGE(R)@@ | +| Berlin | 9 | 15 | 12 | @@=AVERAGE(R)@@ | +| Tokyo | 12 | 20 | 16 | @@=AVERAGE(R)@@ | +| Maximum temperature | @@=MAX(C)@@ | @@=MAX(C)@@ | @@=MAX(C)@@ | | +| Minimum temperature | @@=MIN(C)@@ | @@=MIN(C)@@ | @@=MIN(C)@@ | | +>> + +== Author == + +* Marc-Etienne Vargenau, Alcatel-Lucent + +---- +[[PhpWikiDocumentation]] Property changes on: trunk/pgsrc/Help%2FSpreadsheet ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [phpwiki-checkins] SF.net SVN: phpwiki:[6511] trunk/pgsrc/Help%2FSpreadsheet From: - 2009-02-19 14:09:02 ```Revision: 6511 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6511&view=rev Author: vargenau Date: 2009-02-19 14:08:52 +0000 (Thu, 19 Feb 2009) Log Message: ----------- Add explanation about limitations; remove WikicreoleTable plugin call Modified Paths: -------------- trunk/pgsrc/Help%2FSpreadsheet Modified: trunk/pgsrc/Help%FSpreadsheet =================================================================== --- trunk/pgsrc/Help%2FSpreadsheet 2009-02-18 17:13:09 UTC (rev 6510) +++ trunk/pgsrc/Help%2FSpreadsheet 2009-02-19 14:08:52 UTC (rev 6511) @@ -1,4 +1,4 @@ -Date: Sat, 24 Jan 2009 8:15:24 +0000 +Date: Thu, 19 Feb 2009 8:15:24 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) X-Rcs-Id: \$Id\$ Content-Type: application/x-phpwiki; @@ -52,7 +52,6 @@ === Sum === -<< WikicreoleTable |=Region |=Telecom Sales |=Power Sales |=Other |=TOTAL | |=Europe | 320 | 80 | 120 |@@=SUM(R)@@ | |=Asia | 580 | 723 | 564 |@@=SUM(R)@@ | @@ -60,10 +59,8 @@ |=South America | 120 | 35 | 82 |@@=SUM(R)@@ | |=Antarctica | 0 | 0 | 12 |@@=SUM(R)@@ | |=TOTAL | @@=SUM(C)@@ | @@=SUM(C)@@ | @@=SUM(C)@@ |Grand total: @@=SUM(R)@@ | ->> -<< WikicreoleTable |=Region |=Telecom Sales |=Power Sales |=Other |=TOTAL | |=Europe | 320 | 80 | 120 |@@=SUM(R)@@ | |=Asia | 580 | 723 | 564 |@@=SUM(R)@@ | @@ -71,56 +68,75 @@ |=South America | 120 | 35 | 82 |@@=SUM(R)@@ | |=Antarctica | 0 | 0 | 12 |@@=SUM(R)@@ | |=TOTAL | @@=SUM(C)@@ | @@=SUM(C)@@ | @@=SUM(C)@@ |Grand total: @@=SUM(R)@@ | ->> Total of both colums and rows is calculated automatically by wiki. === Count and Sum === -<< WikicreoleTable |=Bug |=Priority |=Subject |=Status |=Days to fix -| 1231 | Low | File Open ... | Open | 3 -| 1232 | High | Memory Window ... | Fixed | 2 -| 1233 | Medium | Usability issue ... | Assigned | 5 -| 1234 | High | No arrange ... | Fixed | 1 +| 1231 | Low | File Open ... | Open | 3 +| 1232 | High | Memory Window ... | Fixed | 2 +| 1233 | Medium | Usability issue ... | Assigned | 5 +| 1234 | High | No arrange ... | Fixed | 1 | Number of bugs: @@=COUNT(C)@@ | | | | Total: @@=SUM(C)@@ days ->> -<< WikicreoleTable |=Bug |=Priority |=Subject |=Status |=Days to fix -| 1231 | Low | File Open ... | Open | 3 -| 1232 | High | Memory Window ... | Fixed | 2 -| 1233 | Medium | Usability issue ... | Assigned | 5 -| 1234 | High | No arrange ... | Fixed | 1 +| 1231 | Low | File Open ... | Open | 3 +| 1232 | High | Memory Window ... | Fixed | 2 +| 1233 | Medium | Usability issue ... | Assigned | 5 +| 1234 | High | No arrange ... | Fixed | 1 | Number of bugs: @@=COUNT(C)@@ | | | | Total: @@=SUM(C)@@ days ->> === Min, Max and Average === -<< WikicreoleTable |=Location |=Morning |=Noon |=Evening |=Average temperature | -| Paris | 7 | 13 | 10 | @@=AVERAGE(R)@@ | -| London | 3 | 10 | 8 | @@=AVERAGE(R)@@ | -| Berlin | 9 | 15 | 12 | @@=AVERAGE(R)@@ | -| Tokyo | 12 | 20 | 16 | @@=AVERAGE(R)@@ | +| Paris | 7 | 13 | 10 | @@=AVERAGE(R)@@ | +| London | 3 | 10 | 8 | @@=AVERAGE(R)@@ | +| Berlin | 9 | 15 | 12 | @@=AVERAGE(R)@@ | +| Tokyo | 12 | 20 | 16 | @@=AVERAGE(R)@@ | | Maximum temperature | @@=MAX(C)@@ | @@=MAX(C)@@ | @@=MAX(C)@@ | | | Minimum temperature | @@=MIN(C)@@ | @@=MIN(C)@@ | @@=MIN(C)@@ | | ->> -<< WikicreoleTable |=Location |=Morning |=Noon |=Evening |=Average temperature | -| Paris | 7 | 13 | 10 | @@=AVERAGE(R)@@ | -| London | 3 | 10 | 8 | @@=AVERAGE(R)@@ | -| Berlin | 9 | 15 | 12 | @@=AVERAGE(R)@@ | -| Tokyo | 12 | 20 | 16 | @@=AVERAGE(R)@@ | +| Paris | 7 | 13 | 10 | @@=AVERAGE(R)@@ | +| London | 3 | 10 | 8 | @@=AVERAGE(R)@@ | +| Berlin | 9 | 15 | 12 | @@=AVERAGE(R)@@ | +| Tokyo | 12 | 20 | 16 | @@=AVERAGE(R)@@ | | Maximum temperature | @@=MAX(C)@@ | @@=MAX(C)@@ | @@=MAX(C)@@ | | | Minimum temperature | @@=MIN(C)@@ | @@=MIN(C)@@ | @@=MIN(C)@@ | | ->> +== Limitations == + +The formulas are evaluated line per line, from left to right. + +So this will work: + + +| 10 | -13 | @@=SUM(R)@@ | +| 15 | 17 | @@=SUM(R)@@ | +| @@=SUM(C)@@ | @@=SUM(C)@@ | @@=SUM(R)@@ | + + +| 10 | -13 | @@=SUM(R)@@ | +| 15 | 17 | @@=SUM(R)@@ | +| @@=SUM(C)@@ | @@=SUM(C)@@ | @@=SUM(R)@@ | + +And this will not: + + +| @@=SUM(R)@@ | 10 | -13 | +| @@=SUM(R)@@ | 15 | 17 | +| @@=SUM(R)@@ | @@=SUM(C)@@ | @@=SUM(C)@@ | + + +| @@=SUM(R)@@ | 10 | -13 | +| @@=SUM(R)@@ | 15 | 17 | +| @@=SUM(R)@@ | @@=SUM(C)@@ | @@=SUM(C)@@ | + == Author == * Marc-Etienne Vargenau, Alcatel-Lucent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```