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")))
2
  • You are having a dead bracket in the end of the calculation. Jun 21, 2017 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, 2017 at 8:03

2 Answers 2

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 ";"?

1
  • 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, 2017 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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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