FunctionsAsString.php 1.1 KB

123456789101112131415161718192021222324
  1. <?php
  2. return [
  3. // Note that these are meant to test the parser, not a comprehensive
  4. // test of all Excel functions, which tests are handled elsewhere.
  5. [6, '=SUM(1,2,3)'],
  6. [60, '=SUM(A1:A3)'],
  7. [70, '=SUM(A1,A2,A4)'],
  8. [41, '=SUM(1,namedCell)'],
  9. [50, '=A1+namedCell'],
  10. [3, '=MATCH(6,{4,5,6,2},0)'],
  11. ['#N/A', '=MATCH(8,{4,5,6,2},0)'],
  12. [7, '=HLOOKUP(5,{1,5,10;2,6,11;3,7,12;4,8,13},3,FALSE)'],
  13. ['Hello, World.', '=CONCATENATE("Hello, ", "World.")'],
  14. ['{NON-EMPTY SET}', '=UPPER("{non-EMPTY set}")'], // braces not used for matrix
  15. ['upper', '=LOWER(B1)'],
  16. [false, '=and(B2,B3)'],
  17. [0, '=acos(1)'],
  18. [0.785398, '=round(atan({1,2,3}),6)'], // {1,2,3} will be flattened to 1
  19. [2, '=minverse({-2.5,1.5;2,-1})'], // 2 is the flattened result of {2,3;4,5}
  20. [4, '=MDETERM(MMULT({1,2;3,4},{5,6;7,8}))'], // multiple matrices
  21. [110, '=SUM(A1,Sheet2!$A$1)'], // different sheet absolute address
  22. [220, '=SUM(A2,A2B)'], // defined name on different sheet
  23. ];