AVERAGE.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. return [
  3. [
  4. 11,
  5. [10, 7, 9, 27, 2],
  6. ],
  7. [
  8. 10,
  9. [10, 7, 9, 27, 2, 5],
  10. ],
  11. [
  12. 19,
  13. [10, 15, 32],
  14. ],
  15. [
  16. 8.85,
  17. [10.5, 7.2],
  18. ],
  19. [
  20. 19.2,
  21. [7.2, 5.4, 45],
  22. ],
  23. [
  24. 46.24,
  25. [10.5, 7.2, 200, 5.4, 8.1],
  26. ],
  27. [
  28. 4.025,
  29. [
  30. // The index simulates a cell value
  31. // Numbers and Booleans are both counted
  32. '0.1.A' => 1,
  33. '0.2.A' => '2',
  34. '0.3.A' => 3.4,
  35. '0.4.A' => true,
  36. '0.5.A' => 5,
  37. '0.6.A' => null,
  38. '0.7.A' => 6.7,
  39. '0.8.A' => 'STRING',
  40. '0.9.A' => '',
  41. ],
  42. ],
  43. [
  44. 3.183333333333,
  45. [1, '2', 3.4, true, 5, 6.7],
  46. ],
  47. [
  48. // When non-numeric strings are passed directly, then a #VALUE! error is raised
  49. '#VALUE!',
  50. [1, '2', 3.4, true, 5, null, 6.7, 'STRING', ''],
  51. ],
  52. [
  53. '#DIV/0!',
  54. [],
  55. ],
  56. ];