Calculated formula for sharepoint list to return "expired"
The formula I am using is:
=IF((DATEDIF(Todaycalc,[TERMINATION DATE],"d"))<0,"Expired","")
开发者_如何学编程
but while it calculates for the NO, I am getting a #NUM error for the part I want to return as "expired". the calculated field is set to text.
I'm not sure what the TodayCalc
item in your DATEDIF
function is. If this is a column then it needs to be inside brackets [Todaycalc]
. If you are trying to use the TODAY
formula to return the current date, you cannot use this (or ME
) in Calculated Columns.
There is a trick to getting this to "work" where you use a column named Today, use it in the formula then delete it. But it is a silly trick since it still only calculates when an item is created/modified. You might as well use the Modified column.
As @thisChrisKent has said you can't use the [Today] trick without some serious workarounds - it just doesn't work as you would expect it too.
You've a couple of options for doing this sort of dynamic view.
Convert the List View Web Part (LVWP) to a Data View Web Part (DVWP) and add formatting via SharePoint designer and/or XSLT/JavaScript
Add javascript in a Content Editor Web Part to apply the formatting - Christophe is a great source for this sort of stuff which you could adapt for your needs.
3rd party products and custom calcualted columns - such as Highlighter, Follow-Up, Corus Works and others (disclaimer - first link is from my own company)
精彩评论