0

can you please help me evaluate what is wrong with the if statement below, i need to use it in a SharePoint 2013 calculated column, but I keep getting an error.

  =if([Today]-[Last Reviewed Month/Year]<=180,"Green"
        ,if(and([Today]-[Last Reviewed Month/Year]>180,[Today]-[Last Reviewed Month/Year]<365),"Yellow"
           , if([Today] -[Last Reviewed Month/Year])>365,"Red")))
  • You are having a dead bracket in the end of the calculation. – Christoffer Jun 21 '17 at 7:59
  • Thanks, I changed the formula as below: =if([Today]-[Last Reviewed Month/Year]<=180,"Green" ,if(and([Today]-[Last Reviewed Month/Year]>180,[Today]-[Last Reviewed Month/Year]<365),"Yellow" , if([Today]-[Last Reviewed Month/Year]>365,"Red"))) , but when i saved the page, i got a runtime error instead – T Zhang Jun 21 '17 at 8:03
0

1) A calculated column can only use the fields that are given by the GUI. The today keyword must then be referencing to an existing column. I do not think you want to do this, perhaps there is your problem.

2) Depending on the installation/language of your SharePoint environment the parameter seperator must be change from comma "," to semicolumn ";"?

  • Hi Bonm014, yes, "Today" is an existing column, and i need to calculate the date difference between [today] and[Last Reviewed Month/Year] ... probably i should use the " datediff" function ... – T Zhang Jun 21 '17 at 8:10
0

Common mistake

Today has restrictions in a Formula:

How to use Today and Me in Calculated column

Your use case will only work if you have a Workflow that updates your custom [Today] fied

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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