Date: Sat, 24 Jan 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;
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]]