If I put the date 31/12/2013 in A1 and another date 1/1/2014 in A2 then a formula like
=A1<A2
Run Code Online (Sandbox Code Playgroud)
gives the expected result, TRUE.
If I put the formula
=A1<1/1/2014
Run Code Online (Sandbox Code Playgroud)
in another cell, it gives the result FALSE.
The question is how to adjust the second formula to make it give the correct result, and why it doesn't work as it stands.
I've been looking at this for a while and have found some related posts like
回顾这个问题,我希望在数组中创建一个运行总计,但在数组的每一行中重新开始
| 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 |
导致
| 1 | 3 | 6 | 10 |
| 5 | 11 | 18 | 26 |
一种解决方案是使用 Makearray,效果很好:
=MAKEARRAY(
2,
4,
LAMBDA(r, c,
SUM(
INDEX(sheet1!A1:D2, r, 1) : INDEX(sheet1!A1:D2, r, c)
)
)
)
Run Code Online (Sandbox Code Playgroud)
不过,我现在希望使用 Let 语句更普遍地编写此内容:
=LET(
range, Sheet1!A1:D2,
MAKEARRAY(
rows(range),
Columns(range),
LAMBDA(r, c,
SUM(INDEX(range, r, 1) : INDEX(range, r, c))
)
)
)
Run Code Online (Sandbox Code Playgroud)
但这会导致
这个非常相似的公式可以正常工作(它不应该解决原始问题,而只是测试是否可以将范围传递到 Let 语句内的 lambda):
=LET(
range, Sheet1!A1:D2,
SCAN(0, range, LAMBDA(a, c, a + c + INDEX(range, 1, 1)))
)
Run Code Online (Sandbox Code Playgroud)
相同的代码还可以将范围作为参数传递到 …
这是一个相当基本的问题,但我一直无法找到以前的答案-可能部分是因为很难在没有很多错误匹配的情况下搜索“ N函数”。
如果单元格包含数字,则N函数是返回数字的简洁方法;如果单元格包含文本,则N函数是返回零的简洁方法。它比使用ISNUMBER函数短,并且在数组公式中可能很有用。
我为什么要写
=SUM(N({1,2,3}))
Run Code Online (Sandbox Code Playgroud)
得到答案6,但是如果我写
=SUM(N(A1:A3))
Run Code Online (Sandbox Code Playgroud)
A1:A3包含一些数字,我只是得到第一个数字?
如果我转到“求值公式”,则表明即使将A1:A3作为数组公式输入,也不会将A1:A3视为数组。
有没有一种方法可以强制N函数在数组公式中工作?