Calculated Date Field Based on Other Fields

James Snider 1 Reputation point
2021-07-12T18:14:26.187+00:00

I'm trying to calculate a due date field based on two other fields in a SharePoint Online list: [Created] and [Priority]. [Created] is auto-populated when the user creates the new list item. Easy enough. The user selects a [Priority] (Critical, High, Medium, Low). My formula always results in an error due to the pre-populated date field. Surely there's a way around this that I'm just ignorant of. It works fine in Excel, but SP pukes when I try it. TIA!

=IF([Priority]="Critical",[Created]+1,IF([Priority]="High",[Created]+3,IF([Priority]="Medium",[Created]+7,[Created]+14)))
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. CaseyYang-MSFT 10,461 Reputation points
    2021-07-13T05:54:38.533+00:00

    Hi @James Snider ,

    Per my test, you could add a new calculated column with your formula. Remember to select "Date and Time" in "The data type returned from this formula is".

    114101-1.png

    Here is my test result.

    114092-2.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    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.


  2. James Snider 1 Reputation point
    2021-07-13T17:08:28.857+00:00

    Hi @CaseyYang-MSFT

    Thanks for your reply! However, I'm still hitting the same error wall. I've included a screenshot of my calculated field settings and the error I get. The Create Date is auto populated when the list item is made. I want to calculate the Due Date based on Create Date + Priority.
    Neither of these formulas worked: =IF([Priority]="Critical",[Created]+1,IF([Priority]="High",[Created]+3,IF([Priority]="Medium",[Created]+7,[Created]+14)))

    =IF(Priority="Critical",Created+1,IF(Priority="High",Created+3,IF(Priority="Medium",Created+7,Created+14)))  
    

    114219-fieldsettings.png

    114264-error.png


  3. Scala, T AARP 0 Reputation points
    2023-01-31T16:00:25.9766667+00:00

    I experience the same problem. I believe the difference is between the column type, Calculated, in @CaseyYang-MSFT 's reply, and Date and Time, in your example. Calculated type allows for references to other columns, however even formatted as a date, is not available for Calendar view. Date and Time allows functions and formulas but not other columns.

    0 comments No comments

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.