]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FSpreadsheet
Description of spreadsheet syntax in Wikicreole tables
[SourceForge/phpwiki.git] / pgsrc / Help%2FSpreadsheet
1 Date: Tue, 11 Jan 2009 8:18:24 +0100
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124)
3 X-Rcs-Id: $Id$
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FSpreadsheet;
6   flags=PAGE_LOCKED;
7   markup=2;
8   charset=iso-8859-1
9 Content-Transfer-Encoding: binary
10
11 Phpwiki has extented the [[Help:Wikicreole|Wikicreole]] syntax of tables so that some simple
12 spreadsheet-like calculations can be performed in tables.
13
14 == Syntax ==
15
16 Five functions are available: SUM, AVERAGE, MAX, MIN and COUNT.
17
18 They operate on the current row (R) or column (C).
19
20 The function is placed in the cell surrounded by ##@@##.
21 Other wiki text can be placed in the cell, but there can be only one formula per cell.
22
23 {| class="bordered"
24 |-
25 | Formula || Meaning
26 |-
27 | @@=SUM(R)@@ || Sum of cells in current row
28 |-
29 | @@=SUM(C)@@ || Sum of cells in current column
30 |-
31 | @@=AVERAGE(R)@@ || Average of cells in current row
32 |-
33 | @@=AVERAGE(C)@@ || Average of cells in current column
34 |-
35 | @@=MAX(R)@@ || Maximum value of cells in current row
36 |-
37 | @@=MAX(C)@@ || Maximum value of cells in current column
38 |-
39 | @@=MIN(R)@@ || Minimum value of cells in current row
40 |-
41 | @@=MIN(C)@@ || Minimum value of cells in current column
42 |-
43 | @@=COUNT(R)@@
44 | Number of cells in current row (numeric or not, excluding headers and current cell)
45 |-
46 | @@=COUNT(C)@@
47 | Number of cells in current column (numeric or not, excluding headers and current cell)
48 |}
49
50 == Examples ==
51
52 === Sum ===
53
54 <verbatim>
55 << WikicreoleTable
56 |=Region          |=Telecom Sales  |=Power Sales |=Other       |=TOTAL      |
57 |=Europe          |            320 |          80 |         120 |@@=SUM(R)@@ |
58 |=Asia            |            580 |         723 |         564 |@@=SUM(R)@@ |
59 |=North America   |            235 |          60 |         109 |@@=SUM(R)@@ |
60 |=South America   |            120 |          35 |          82 |@@=SUM(R)@@ |
61 |=Antarctica      |              0 |           0 |          12 |@@=SUM(R)@@ |
62 |=TOTAL           |    @@=SUM(C)@@ | @@=SUM(C)@@ | @@=SUM(C)@@ |Grand total: @@=SUM(R)@@ |
63 >>
64 </verbatim>
65
66 << WikicreoleTable
67 |=Region          |=Telecom Sales  |=Power Sales |=Other       |=TOTAL      |
68 |=Europe          |            320 |          80 |         120 |@@=SUM(R)@@ |
69 |=Asia            |            580 |         723 |         564 |@@=SUM(R)@@ |
70 |=North America   |            235 |          60 |         109 |@@=SUM(R)@@ |
71 |=South America   |            120 |          35 |          82 |@@=SUM(R)@@ |
72 |=Antarctica      |              0 |           0 |          12 |@@=SUM(R)@@ |
73 |=TOTAL           |    @@=SUM(C)@@ | @@=SUM(C)@@ | @@=SUM(C)@@ |Grand total: @@=SUM(R)@@ |
74 >>
75
76 Total of both colums and rows is calculated automatically by wiki.
77
78 === Count and Sum ===
79
80 <verbatim>
81 << WikicreoleTable
82 |=Bug                |=Priority   |=Subject             |=Status     |=Days to fix
83 | 1231               | Low        | File Open ...       | Open       | 3
84 | 1232               | High       | Memory Window ...   | Fixed      | 2
85 | 1233               | Medium     | Usability issue ... | Assigned   | 5
86 | 1234               | High       | No arrange ...      | Fixed      | 1
87 | Number of bugs: @@=COUNT(C)@@ | |                     |            | Total: @@=SUM(C)@@ days
88 >>
89 </verbatim>
90
91 << WikicreoleTable
92 |=Bug                |=Priority   |=Subject             |=Status     |=Days to fix
93 | 1231               | Low        | File Open ...       | Open       | 3
94 | 1232               | High       | Memory Window ...   | Fixed      | 2
95 | 1233               | Medium     | Usability issue ... | Assigned   | 5
96 | 1234               | High       | No arrange ...      | Fixed      | 1
97 | Number of bugs: @@=COUNT(C)@@ | |                     |            | Total: @@=SUM(C)@@ days
98 >>
99
100 === Min, Max and Average ===
101
102 <verbatim>
103 << WikicreoleTable
104 |=Location            |=Morning     |=Noon        |=Evening     |=Average temperature |
105 | Paris               | 7           | 13          | 10          | @@=AVERAGE(R)@@     |
106 | London              | 3           | 10          | 8           | @@=AVERAGE(R)@@     |
107 | Berlin              | 9           | 15          | 12          | @@=AVERAGE(R)@@     |
108 | Tokyo               | 12          | 20          | 16          | @@=AVERAGE(R)@@     |
109 | Maximum temperature | @@=MAX(C)@@ | @@=MAX(C)@@ | @@=MAX(C)@@ |                     |
110 | Minimum temperature | @@=MIN(C)@@ | @@=MIN(C)@@ | @@=MIN(C)@@ |                     |
111 >>
112 </verbatim>
113
114 << WikicreoleTable
115 |=Location            |=Morning     |=Noon        |=Evening     |=Average temperature |
116 | Paris               | 7           | 13          | 10          | @@=AVERAGE(R)@@     |
117 | London              | 3           | 10          | 8           | @@=AVERAGE(R)@@     |
118 | Berlin              | 9           | 15          | 12          | @@=AVERAGE(R)@@     |
119 | Tokyo               | 12          | 20          | 16          | @@=AVERAGE(R)@@     |
120 | Maximum temperature | @@=MAX(C)@@ | @@=MAX(C)@@ | @@=MAX(C)@@ |                     |
121 | Minimum temperature | @@=MIN(C)@@ | @@=MIN(C)@@ | @@=MIN(C)@@ |                     |
122 >>
123
124 == Author ==
125
126 * Marc-Etienne Vargenau, Alcatel-Lucent
127
128 ----
129 [[PhpWikiDocumentation]]