• td上添加属性:formula,无需设定具体值
    1. <table>
    2. <tr>
    3. <td>1</td>
    4. </tr>
    5. <tr>
    6. <td>19</td>
    7. </tr>
    8. <tr>
    9. <td formula>SUM(A1:A2)</td>
    10. </tr>
    11. </table>
    • td中书写具体的公式即可,如:SUM(A1:A2)支持公式如下:
    1. private static Function[] produceFunctions() {
    2. Function[] retval = new Function[368];
    3.  
    4. retval[0] = new Count();
    5. retval[FunctionID.IF] = new IfFunc(); //nominally 1
    6. retval[2] = LogicalFunction.ISNA;
    7. retval[3] = LogicalFunction.ISERROR;
    8. retval[FunctionID.SUM] = AggregateFunction.SUM; //nominally 4
    9. retval[5] = AggregateFunction.AVERAGE;
    10. retval[6] = AggregateFunction.MIN;
    11. retval[7] = AggregateFunction.MAX;
    12. retval[8] = new RowFunc(); // ROW
    13. retval[9] = new Column();
    14. retval[10] = new Na();
    15. retval[11] = new Npv();
    16. retval[12] = AggregateFunction.STDEV;
    17. retval[13] = NumericFunction.DOLLAR;
    18. retval[14] = new Fixed();
    19. retval[15] = NumericFunction.SIN;
    20. retval[16] = NumericFunction.COS;
    21. retval[17] = NumericFunction.TAN;
    22. retval[18] = NumericFunction.ATAN;
    23. retval[19] = NumericFunction.PI;
    24. retval[20] = NumericFunction.SQRT;
    25. retval[21] = NumericFunction.EXP;
    26. retval[22] = NumericFunction.LN;
    27. retval[23] = NumericFunction.LOG10;
    28. retval[24] = NumericFunction.ABS;
    29. retval[25] = NumericFunction.INT;
    30. retval[26] = NumericFunction.SIGN;
    31. retval[27] = NumericFunction.ROUND;
    32. retval[28] = new Lookup();
    33. retval[29] = new Index();
    34. retval[30] = new Rept();
    35. retval[31] = TextFunction.MID;
    36. retval[32] = TextFunction.LEN;
    37. retval[33] = new Value();
    38. retval[34] = BooleanFunction.TRUE;
    39. retval[35] = BooleanFunction.FALSE;
    40. retval[36] = BooleanFunction.AND;
    41. retval[37] = BooleanFunction.OR;
    42. retval[38] = BooleanFunction.NOT;
    43. retval[39] = NumericFunction.MOD;
    44. // 40: DCOUNT
    45. retval[41] = new DStarRunner(DStarRunner.DStarAlgorithmEnum.DSUM);
    46. // 42: DAVERAGE
    47. retval[43] = new DStarRunner(DStarRunner.DStarAlgorithmEnum.DMIN);
    48. retval[44] = new DStarRunner(DStarRunner.DStarAlgorithmEnum.DMAX);
    49. // 45: DSTDEV
    50. retval[46] = AggregateFunction.VAR;
    51. // 47: DVAR
    52. retval[48] = TextFunction.TEXT;
    53. // 49: LINEST
    54. retval[50] = new Trend();
    55. // 51: LOGEST
    56. // 52: GROWTH
    57.  
    58. retval[56] = FinanceFunction.PV;
    59. retval[57] = FinanceFunction.FV;
    60. retval[58] = FinanceFunction.NPER;
    61. retval[59] = FinanceFunction.PMT;
    62. retval[60] = new Rate();
    63. retval[61] = new Mirr();
    64. retval[62] = new Irr();
    65. retval[63] = NumericFunction.RAND;
    66. retval[64] = new Match();
    67. retval[65] = DateFunc.instance;
    68. retval[66] = new TimeFunc();
    69. retval[67] = CalendarFieldFunction.DAY;
    70. retval[68] = CalendarFieldFunction.MONTH;
    71. retval[69] = CalendarFieldFunction.YEAR;
    72. retval[70] = WeekdayFunc.instance;
    73. retval[71] = CalendarFieldFunction.HOUR;
    74. retval[72] = CalendarFieldFunction.MINUTE;
    75. retval[73] = CalendarFieldFunction.SECOND;
    76. retval[74] = new Now();
    77. retval[75] = new Areas();
    78. retval[76] = new Rows();
    79. retval[77] = new Columns();
    80. retval[FunctionID.OFFSET] = new Offset(); //nominally 78
    81.  
    82. retval[82] = TextFunction.SEARCH;
    83. retval[83] = MatrixFunction.TRANSPOSE;
    84.  
    85. // 86: TYPE
    86.  
    87. retval[97] = NumericFunction.ATAN2;
    88. retval[98] = NumericFunction.ASIN;
    89. retval[99] = NumericFunction.ACOS;
    90. retval[FunctionID.CHOOSE] = new Choose(); //nominally 100
    91. retval[101] = new Hlookup();
    92. retval[102] = new Vlookup();
    93.  
    94. retval[105] = LogicalFunction.ISREF;
    95.  
    96. retval[109] = NumericFunction.LOG;
    97.  
    98. retval[111] = TextFunction.CHAR;
    99. retval[112] = TextFunction.LOWER;
    100. retval[113] = TextFunction.UPPER;
    101. retval[114] = TextFunction.PROPER;
    102. retval[115] = TextFunction.LEFT;
    103. retval[116] = TextFunction.RIGHT;
    104. retval[117] = TextFunction.EXACT;
    105. retval[118] = TextFunction.TRIM;
    106. retval[119] = new Replace();
    107. retval[120] = new Substitute();
    108. retval[121] = new Code();
    109.  
    110. retval[124] = TextFunction.FIND;
    111. // 125: CELL
    112.  
    113. retval[126] = LogicalFunction.ISERR;
    114. retval[127] = LogicalFunction.ISTEXT;
    115. retval[128] = LogicalFunction.ISNUMBER;
    116. retval[129] = LogicalFunction.ISBLANK;
    117. retval[130] = new T();
    118. // 131: N
    119. // 140: DATEVALUE
    120. // 141: TIMEVALUE
    121. // 142: SLN
    122. // 143: SYD
    123. // 144: DDB
    124.  
    125. retval[FunctionID.INDIRECT] = null; // Indirect.evaluate has different signature
    126.  
    127. retval[162] = TextFunction.CLEAN;
    128.  
    129. retval[163] = MatrixFunction.MDETERM;
    130. retval[164] = MatrixFunction.MINVERSE;
    131. retval[165] = MatrixFunction.MMULT;
    132.  
    133. retval[167] = new IPMT();
    134. retval[168] = new PPMT();
    135. retval[169] = new Counta();
    136.  
    137. retval[183] = AggregateFunction.PRODUCT;
    138. retval[184] = NumericFunction.FACT;
    139.  
    140. // 189: DPRODUCT
    141. retval[190] = LogicalFunction.ISNONTEXT;
    142.  
    143. retval[194] = AggregateFunction.VARP;
    144. // 195: DSTDEVP
    145. // 196: DVARP
    146. retval[197] = NumericFunction.TRUNC;
    147. retval[198] = LogicalFunction.ISLOGICAL;
    148. // 199: DCOUNTA
    149.  
    150. //204: USDOLLAR (YEN in BIFF3)
    151. //205: FINDB
    152. //206: SEARCHB
    153. //207: REPLACEB
    154. //208: LEFTB
    155. //209: RIGHTB
    156. //210: MIDB
    157. //211: LENB
    158. retval[212] = NumericFunction.ROUNDUP;
    159. retval[213] = NumericFunction.ROUNDDOWN;
    160. //214: ASC
    161. //215: DBCS (JIS in BIFF3)
    162. retval[216] = new Rank();
    163. retval[219] = new Address();
    164. retval[220] = new Days360();
    165. retval[221] = new Today();
    166. //222: VBD
    167.  
    168. retval[227] = AggregateFunction.MEDIAN;
    169. retval[228] = new Sumproduct();
    170. retval[229] = NumericFunction.SINH;
    171. retval[230] = NumericFunction.COSH;
    172. retval[231] = NumericFunction.TANH;
    173. retval[232] = NumericFunction.ASINH;
    174. retval[233] = NumericFunction.ACOSH;
    175. retval[234] = NumericFunction.ATANH;
    176. retval[235] = new DStarRunner(DStarRunner.DStarAlgorithmEnum.DGET);
    177.  
    178. // 244: INFO
    179.  
    180. // 247: DB
    181. // 252: FEQUENCY
    182. retval[252] = Frequency.instance;
    183.  
    184. retval[FunctionID.EXTERNAL_FUNC] = null; // ExternalFunction is a FreeRefFunction, nominally 255
    185.  
    186. retval[261] = new Errortype();
    187.  
    188. retval[269] = AggregateFunction.AVEDEV;
    189. // 270: BETADIST
    190. // 271: GAMMALN
    191. // 272: BETAINV
    192. // 273: BINOMDIST
    193. // 274: CHIDIST
    194. // 275: CHIINV
    195. retval[276] = NumericFunction.COMBIN;
    196. // 277: CONFIDENCE
    197. // 278:CRITBINOM
    198. retval[279] = new Even();
    199. // 280: EXPONDIST
    200. // 281: FDIST
    201. // 282: FINV
    202. // 283: FISHER
    203. // 284: FISHERINV
    204. retval[285] = NumericFunction.FLOOR;
    205. // 286: GAMMADIST
    206. // 287: GAMMAINV
    207. retval[288] = NumericFunction.CEILING;
    208. // 289: HYPGEOMDIST
    209. // 290: LOGNORMDIST
    210. // 291: LOGINV
    211. // 292: NEGBINOMDIST
    212. // 293: NORMDIST
    213. // 294: NORMSDIST
    214. // 295: NORMINV
    215. // 296: NORMSINV
    216. // 297: STANDARDIZE
    217. retval[298] = new Odd();
    218. // 299: PERMUT
    219. retval[300] = NumericFunction.POISSON;
    220. // 301: TDIST
    221. // 302: WEIBULL
    222. retval[303] = new Sumxmy2();
    223. retval[304] = new Sumx2my2();
    224. retval[305] = new Sumx2py2();
    225. // 306: CHITEST
    226. // 307: CORREL
    227. // 308: COVAR
    228. // 309: FORECAST
    229. // 310: FTEST
    230. retval[311] = new Intercept();
    231. // 312: PEARSON
    232. // 313: RSQ
    233. // 314: STEYX
    234. retval[315] = new Slope();
    235. // 316: TTEST
    236. // 317: PROB
    237. retval[318] = AggregateFunction.DEVSQ;
    238. retval[319] = AggregateFunction.GEOMEAN;
    239. // 320: HARMEAN
    240. retval[321] = AggregateFunction.SUMSQ;
    241. // 322: KURT
    242. // 323: SKEW
    243. // 324: ZTEST
    244. retval[325] = AggregateFunction.LARGE;
    245. retval[326] = AggregateFunction.SMALL;
    246. // 327: QUARTILE
    247. retval[328] = AggregateFunction.PERCENTILE;
    248. // 329: PERCENTRANK
    249. retval[330] = new Mode();
    250. // 331: TRIMMEAN
    251. // 332: TINV
    252.  
    253. retval[336] = TextFunction.CONCATENATE;
    254. retval[337] = NumericFunction.POWER;
    255.  
    256. retval[342] = NumericFunction.RADIANS;
    257. retval[343] = NumericFunction.DEGREES;
    258. retval[344] = new Subtotal();
    259. retval[345] = new Sumif();
    260. retval[346] = new Countif();
    261. retval[347] = new Countblank();
    262.  
    263. // 350: ISPMT
    264. // 351: DATEDIF
    265. // 352: DATESTRING
    266. // 353: NUMBERSTRING
    267. retval[354] = new Roman();
    268.  
    269. // 358: GETPIVOTDATA
    270. retval[359] = new Hyperlink();
    271. // 360: PHONETIC
    272. // 361: AVERAGEA
    273. retval[362] = MinaMaxa.MAXA;
    274. retval[363] = MinaMaxa.MINA;
    275. // 364: STDEVPA
    276. // 365: VARPA
    277. // 366: STDEVA
    278. // 367: VARA
    279. }