【发布时间】:2020-08-10 13:40:56
【问题描述】:
考虑一个包含“源”电子表格和“格式化”工作表的电子表格 格式化工作表引用源工作表中的数据。
实现这一点的理想方法是使用数组公式
# formatted-sheet (formulas)
| title | description |
------------------------
| = ArrayFormula(source!A2:AA) | |
| | |
| | |
# source (raw data)
| title | description |
------------------------
| SomeTitle | long description |
| OtherTitle | Other description |
| emptyDesc | |
在 google 电子表格中,生成的格式化工作表显示如下:
# formatted-sheet (rendering formulas)
| title | description |
------------------------
| SomeTitle | long description |
| OtherTitle | Other description |
| emptyDesc | |
但是导出为Excel格式后,空值显示为“0”
# formatted-sheet (rendering formulas)
| title | description |
------------------------
| SomeTitle | long description |
| OtherTitle | Other description |
| emptyDesc | 0 |
| 0 | 0 | # for every additional line captures by the array formula, zeroes everywhere
我为此找到的解决方法是使用 IF 检查空字符串值
# formatted-sheet (formulas)
| title | description |
------------------------
| = ArrayFormula(IF(source!A2:AA = ""; ""; source!A2:AA)) | |
| | |
但是,如果单元格长度超过 255 个字符,IF() 公式会被破坏,是否有不同的解决方法? 敌人示例一种在导出到 xlsx 并使用 Microsoft Excel 打开后将空字符串显示为“0”的方法?还是改进公式?
这是参考for a sample sheet。
【问题讨论】:
标签: excel google-sheets