Files
oleibman f3c3aba618 TOCOL and TOROW
TOCOL and TOROW were introduced to Excel in 2024, and will now be supported by PhpSpreadsheet. The documentation says that, under certain circumstances, "blanks" will be ignored. This seems demonstrably wrong. In the right circumstance, Excel will ignore nulls, not blanks. Further, when it decides to not ignore the nulls, it changes them to 0, which also seems insufficiently documented. PhpSpreadsheet will behave as Excel does.

I discovered some minor problems and some missing test conditions for the TRANSPOSE function while testing these. Those are now fixed.
2025-05-28 23:15:06 -07:00

51 lines
866 B
PHP

<?php
declare(strict_types=1);
return [
[
[
['Jan', 'Feb', 'Mar', 'Apr'],
[100, 200, 150, 300],
],
[
['Jan', 100],
['Feb', 200],
['Mar', 150],
['Apr', 300],
],
],
[
[
['a', 'aa'],
['b', 'ab'],
['c', 'ac'],
['d', 'ad'],
],
[
['a', 'b', 'c', 'd'],
['aa', 'ab', 'ac', 'ad'],
],
],
[
[[3.14]],
3.14,
],
'single row' => [
[[1], [2], [3], [4]],
[[1, 2, 3, 4]],
],
'single row 1-D' => [
[[1], [2], [3], [4]],
[1, 2, 3, 4],
],
'single column' => [
[[1, 2, 3, 4]],
[[1], [2], [3], [4]],
],
'single cell' => [
[[1]],
[[1]],
],
];