gpt4 book ai didi

Excel 公式使用 today()

转载 作者:行者123 更新时间:2023-12-04 21:30:43 26 4
gpt4 key购买 nike

想知道是否有人可以帮助我使用这个 Excel 公式。

我有一个字段,其日期格式如下

2018-07-02 11:37:19YYYY-MM-DD HH:MM:SS

In the adjacent column I have the following formula which displays a date and rounds the time off to the nearest 30 mins if it's today or adds some text if it's a historical day.

=IF(
A2<=TODAY()-1,
"16 Hours Failed",
IF(
A2<=TODAY(),
"16 Hours Failed Yesterday",
FLOOR(A2,0.5/24)
)
)

最后我有另一列(公式粘贴在下面),它使用 Col B 来确定它是否已经失败,已经失败的工作正常。然而没有一个 TODAY()函数工作,我感觉这可能与 Excel 如何解释 TODAY() 有关.有人可以帮忙吗?
=IF(
B2="16 Hours Failed",
"Failed Already",
IF(
B2="16 Hours Failed Yesterday",
"Failed Yesterday",
IF(
B2=TODAY(),
"Failing Today",
IF(
B2=TODAY()+1,
"Failing Tomorrow",
IF(
B2>=TODAY()+2,
"Failing After 3 Or More Days",
INT(B2)
)
)
)
)
)

最佳答案

FLOOR(A2, 0.5/24)向下舍入到最接近的半小时。
TODAY()返回具有零时间分量(午夜)的日期。

两者仅对于时间从 00:00:00 到 00:30:00 的源日期相等。

显然你想要

IF(
INT(B2) = TODAY(),
...
IF(
INT(B2) = TODAY()+1,
...

关于Excel 公式使用 today(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52738175/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com