SharePoint 2010计算列表列
SharePoint 2010计算列表列,sharepoint,Sharepoint,=如果([月(计算)]=“1”、“1”、“无日期”) =如果([月份(计算)]=“2”、“2”、“无日期”) =如果([月(计算)]=“3”、“3”、“无日期”) =如果([月(计算)]=“4”、“4”、“无日期”) =如果([月(计算)]=“5”、“5”、“无日期”) =如果([月(计算)]=“6”、“6”、“无日期”) =如果([月(计算)]=“7”、“7”、“无日期”) =如果([月(计算)]=“8”、“8”、“无日期”) =如果([月(计算)]=“9”、“9”、“无日期”) =如果([月
=如果([月(计算)]=“1”、“1”、“无日期”)
=如果([月份(计算)]=“2”、“2”、“无日期”)
=如果([月(计算)]=“3”、“3”、“无日期”)
=如果([月(计算)]=“4”、“4”、“无日期”)
=如果([月(计算)]=“5”、“5”、“无日期”)
=如果([月(计算)]=“6”、“6”、“无日期”)
=如果([月(计算)]=“7”、“7”、“无日期”)
=如果([月(计算)]=“8”、“8”、“无日期”)
=如果([月(计算)]=“9”、“9”、“无日期”)
=如果([月(计算)]=“10”、“10”、“无日期”)
=如果([月份(计算)]=“11”、“11”、“无日期”)
=如果([月(计算)]=“12”、“12”、“无日期”)
您只需将条件嵌套在每个IF()块的“false”部分
举个简单的例子,想象一下如果你只有两个月。从概念上讲,您的公式可能如下所示:
IF([Month (Calculated)]="11", // if the column equals 11...
"November", // then display "November"
IF([Month (Calculated)]="12", // otherwise... if the column equals 12
"December", // then display "December"
"No date" // otherwise... display "No date"
)
)
IF([Month (Calculated)]="1", "January", IF([Month (Calculated)]="2", "February", IF([Month (Calculated)]="3", "March", IF([Month (Calculated)]="4", "April", IF([Month (Calculated)]="5", "May", IF([Month (Calculated)]="6", "June", IF([Month (Calculated)]="7", "July", IF([Month (Calculated)]="8", "August", IF([Month (Calculated)]="9", "September", IF([Month (Calculated)]="10", "October", IF([Month (Calculated)]="11", "November", IF([Month (Calculated)]="12", "December", "No date"))))))))))))
这转化为以下单线公式:
IF([Month (Calculated)]="11","November",IF([Month (Calculated)]="12", "December","No date"))
现在,只要将该方法扩展到所有12个月,您将得到如下公式:
IF([Month (Calculated)]="11", // if the column equals 11...
"November", // then display "November"
IF([Month (Calculated)]="12", // otherwise... if the column equals 12
"December", // then display "December"
"No date" // otherwise... display "No date"
)
)
IF([Month (Calculated)]="1", "January", IF([Month (Calculated)]="2", "February", IF([Month (Calculated)]="3", "March", IF([Month (Calculated)]="4", "April", IF([Month (Calculated)]="5", "May", IF([Month (Calculated)]="6", "June", IF([Month (Calculated)]="7", "July", IF([Month (Calculated)]="8", "August", IF([Month (Calculated)]="9", "September", IF([Month (Calculated)]="10", "October", IF([Month (Calculated)]="11", "November", IF([Month (Calculated)]="12", "December", "No date"))))))))))))
不幸的是,该公式超过了计算列公式的255个字符限制。要绕过该限制,可以使用其他计算列将公式分解为更小的部分
下面是一个如何打破这种局面的例子:
计算列1:
IF([Month (Calculated)]="7","July",IF([Month (Calculated)]="8","August",IF([Month (Calculated)]="9","September",IF([Month (Calculated)]="10","October",IF([Month (Calculated)]="11","November",IF([Month (Calculated)]="12", "December",[Calculated Column 2]))))))
(请注意末尾对[计算列2]
的引用。)
计算列2:
IF([Month (Calculated)]="1","January",IF([Month (Calculated)]="2","February",IF([Month (Calculated)]="3","March",IF([Month (Calculated)]="4","April",IF([Month (Calculated)]="5","May","No date")))))
只需将条件嵌套在每个IF()
块的“false”部分
举个简单的例子,想象一下如果你只有两个月。从概念上讲,您的公式可能如下所示:
IF([Month (Calculated)]="11", // if the column equals 11...
"November", // then display "November"
IF([Month (Calculated)]="12", // otherwise... if the column equals 12
"December", // then display "December"
"No date" // otherwise... display "No date"
)
)
IF([Month (Calculated)]="1", "January", IF([Month (Calculated)]="2", "February", IF([Month (Calculated)]="3", "March", IF([Month (Calculated)]="4", "April", IF([Month (Calculated)]="5", "May", IF([Month (Calculated)]="6", "June", IF([Month (Calculated)]="7", "July", IF([Month (Calculated)]="8", "August", IF([Month (Calculated)]="9", "September", IF([Month (Calculated)]="10", "October", IF([Month (Calculated)]="11", "November", IF([Month (Calculated)]="12", "December", "No date"))))))))))))
这转化为以下单线公式:
IF([Month (Calculated)]="11","November",IF([Month (Calculated)]="12", "December","No date"))
现在,只要将该方法扩展到所有12个月,您将得到如下公式:
IF([Month (Calculated)]="11", // if the column equals 11...
"November", // then display "November"
IF([Month (Calculated)]="12", // otherwise... if the column equals 12
"December", // then display "December"
"No date" // otherwise... display "No date"
)
)
IF([Month (Calculated)]="1", "January", IF([Month (Calculated)]="2", "February", IF([Month (Calculated)]="3", "March", IF([Month (Calculated)]="4", "April", IF([Month (Calculated)]="5", "May", IF([Month (Calculated)]="6", "June", IF([Month (Calculated)]="7", "July", IF([Month (Calculated)]="8", "August", IF([Month (Calculated)]="9", "September", IF([Month (Calculated)]="10", "October", IF([Month (Calculated)]="11", "November", IF([Month (Calculated)]="12", "December", "No date"))))))))))))
不幸的是,该公式超过了计算列公式的255个字符限制。要绕过该限制,可以使用其他计算列将公式分解为更小的部分
下面是一个如何打破这种局面的例子:
计算列1:
IF([Month (Calculated)]="7","July",IF([Month (Calculated)]="8","August",IF([Month (Calculated)]="9","September",IF([Month (Calculated)]="10","October",IF([Month (Calculated)]="11","November",IF([Month (Calculated)]="12", "December",[Calculated Column 2]))))))
(请注意末尾对[计算列2]
的引用。)
计算列2:
IF([Month (Calculated)]="1","January",IF([Month (Calculated)]="2","February",IF([Month (Calculated)]="3","March",IF([Month (Calculated)]="4","April",IF([Month (Calculated)]="5","May","No date")))))
紧随其后,
对于中断方法,使用显示结果的第三列
计算列3
If([Calculated Column 1]="No date",[Calculated Column 2],[Calculated Column 1])
紧随其后,
对于中断方法,使用显示结果的第三列
计算列3
If([Calculated Column 1]="No date",[Calculated Column 2],[Calculated Column 1])