SharePoint list calculated column IF statement syntax error

Bowen, Braxton 20 Reputation points
2023-06-22T18:05:44.8033333+00:00

0

I am trying to use a string of IF statements to be able to assign a value to for a calculated column in my SharePoint list. This column will display values based on what a date column reads. The column is supposed to read a value based on if its expired, about to expire, up to date, or never certified. he expiration date is a year later from what the date column reads.

Here is my code:

=IF(ISBLANK([Column_Name]), "Never Certified", IF(Today()-[Column_Name])>=365, "Expired",IF(AND((Today()-[Column_Name])>=335, IF(Today()-[Column_Name]) <=365), "Expires Soon", IF((Today()-[Column_Name]) <=335, "Up to Date", "Error")))))

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. Ling Zhou_MSFT 23,620 Reputation points Microsoft External Staff
    2023-06-23T02:35:51.9466667+00:00

    Hi @Bowen, Braxton,

    Thank you for posting in this community.

    I would like to recommend that you use the DATEDIF function to calculate the number of days between two dates. “Today()-[Column_Name]" is not legal.

    User's image

    You can click on this link to see more information about the date calculation formula:

    date-and-time-formulas

    This is my modified formula:

    =IF(ISBLANK([Column_Name]),"Never Certified",IF(DATEDIF(Today(),[Column_Name],"d")>=365,"Expired",IF(AND(DATEDIF(Today(),[Column_Name],"d")>=335,DATEDIF(Today(),[Column_Name],"d")<=365),"Expires Soon",IF(DATEDIF(Today(),[Column_Name],"d")<=335,"Up to Date","Error"))))
    

    Here is my test result (the value of "Today" is 6/22/2023):

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.