计算列 - 大型嵌套 IF,用于通过状态进行进展

问题描述 投票:0回答:1

我正在尝试为具有大量状态的状态计算列,但无法使其工作,感谢任何帮助。

我正在努力实现这一目标:

If today's date is less than \[Date1\] then \[Status1\]   
If today's date is between \[Date1\] and \[Date2\] then \[Status2\]
If today's date is after \[Date2\] and \[Column1\] is blank then \[Status3\]
If \[Column1\] is filled then \[Status4\]
If \[Column2\] is Yes then \[Status5\] (otherwise it remains at \[Status4\])
If today's date is between \[Date3\] and \[Date4\] then \[Status6\]
If today's date is after \[Date4\] then \[Status7\]

我需要今天的日期始终是今天的日期,而不是根据修改计算。

我的公式如下,但不起作用。感谢您的任何建议:

                IF(NOW()<[Date1],”Status1”,
                    IF(AND(NOW()>[Date1],(NOW()<[Date2],”Status2”),
                        IF(AND(NOW()>[Date2],ISBLANK[Column1],”Status3”),
                            IF([Column1]<>””,”Status4”,
                                IF([Column2]=Yes,”Status5”,
                                    IF(AND(NOW()>[Date3],NOW()<[Date4],”Status6”),
                                        IF(NOW()> [Date4],”Status7”,”Status1”
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
if-statement sharepoint-online calculated-columns status
1个回答
0
投票

您提供的公式有一些语法错误。这是修正后的公式:

IF(NOW() < [Date1], "Status1",
    IF(AND(NOW() > [Date1], NOW() < [Date2]), "Status2",
        IF(AND(NOW() > [Date2], ISBLANK([Column1])), "Status3",
            IF(NOT(ISBLANK([Column1])), "Status4",
                IF([Column2] = "Yes", "Status5", 
                    IF(AND(NOW() > [Date3], NOW() < [Date4]), "Status6",
                        IF(NOW() > [Date4], "Status7", "Status1")
                    )
                )
            )
        )
    )
)
© www.soinside.com 2019 - 2024. All rights reserved.