Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created a calculated field called "Overdue" and provided the below formula as mentioned in the below link. But it is not accepting this formula. Please let me know what might be an issue.

Formula : IF([Due Date]<[TODAY],"#0000FF","#FF0000")

Link : http://www.sharepointkings.com/2009/04/sharepoint-calculated-column-and-jquery.html

share|improve this question
    
Made sure you've got an equals sign (=) before "IF"? (it's a silly mistake but I've made it before a few times). –  James Love Dec 6 '10 at 9:45

1 Answer 1

up vote 3 down vote accepted

As James sugesteed you should put = before your IF statement, but the main problem is that you can't use [Today] in calculated field, but there is a workaround:

1) Create a column caled Today - set it to DateTime and set it to display Today's Date
2) Now you can reference it in your calculated field
3) Remove Today Column and sharepoint will think that [Today] is Todays Date.

Here's the link that also helped me to solve this issue - Today and calculateted fields.
Hope it'll help you.

[EDIT]

I did a little bit more investigetion and found that even if you use this trick next day value of calculated column will still be the same, beacuse calculated fields don’t update themselves until item itself is updated, so thats why calculated columns cannot contain Today and Me - The Truth about using [Today] in SharePoint Calculated Columns.

So if you want to have colored fields you must have something that updates item everyday. Another way is to create several views that displays one category of items (Finished Items, Overdue Items)? but no coloring.

share|improve this answer
    
Keep in mind that it will only calculated on an update of the item. Thus, unless you update all items every day the [Today]-trick will not work! –  Dribbel Dec 6 '10 at 12:02
    
Thanks Andriy & James for your suggestion. I gave up this plan since it will not be updating based on today date automatically. Thanks for your clarification. –  sankar Dec 6 '10 at 12:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.