=IF(
AND(
I2="Y",
O2="Y",
G2<=TIMEVALUE("14:00")
),
"Y",
IF(
AND(
I2="Y",
O2="N",
G2<=TIMEVALUE("12:00")
),
"Y",
IF(
AND(
I2="N",
H2<=TIMEVALUE("6:00")
),
"Y",
"N"
)
)
)
我正在尝试为工作流程自动化此审核表格(参见附图)。我希望 Q 列(准时?)根据以下条件填充 Y 或 N:
我以为我的答案是正确的,但第一条测试线显示“N”,但我希望它显示“Y”。希望有人能指出我的公式哪里出错了。
这是您可以尝试的动态数组公式(首先在单独的列中):
IFS
和 TRIM
(正如 Chronocidal 也建议的那样)ontime
替换为其他变量并查看last_row
计算以匹配您的数据在准时?(
Q2
)的第一个单元格中输入:
=LET(last_row, XMATCH(TRUE, ISNUMBER(A:A), , -1),
overnight, TRIM(I2:INDEX(I:I, last_row)) = "Y",
weekend, TRIM(O2:INDEX(O:O, last_row)) = "Y",
finished_before2pm, G2:INDEX(G:G, last_row) <= TIMEVALUE("14:00"),
finished_before_noon, G2:INDEX(G:G, last_row) <= TIMEVALUE("12:00"),
completed_lt_6hrs, H2:INDEX(H:H, last_row) <= TIMEVALUE("6:00"),
on_time, IFS(
overnight * weekend * finished_before2pm, "Y",
overnight * NOT(weekend) * finished_before_noon, "Y",
NOT(overnight) * completed_lt_6hrs, "Y",
TRUE,"N"),
on_time
)