Share via

Calculated Column based on 2 columns

Paddi Rooney 21 Reputation points
2022-07-13T14:24:40.413+00:00

hi

i was wondering if it was possible to have a calculated column (Next review date) based on the outcomes of 2 columns , one column is a date column (review Date) , the other is a choice column (Document type)

i would like to apply a set number of days to the (Next review date) column based on the selection from the choice (Document type) Column, and the date column (review date)

i have 3 choices that i would like to be 365 days (1 years) and everything else 730 days (2 years)

i'll be honest ive not idea where to start ? so any help would be appreciated

thanks

paddi

Microsoft 365 and Office | SharePoint | For business | Windows

Answer accepted by question author

Yanli Jiang - MSFT 31,691 Reputation points Microsoft External Staff
2022-07-15T11:56:01.587+00:00

According to my research and testing, you can use the following 2 formulas:
1, Set by days:

=IF([document type]="Policy",[review date]+365,[review date]+730)  

221131-07151.png
2, Set by years:

=IF([document type]="Policy",DATE(YEAR([review date])+1,MONTH([review date]),DAY([review date])),DATE(YEAR([review date])+2,MONTH([review date]),DAY([review date])))  

The result:
221085-07152.png

Thanks,
Yanli Jiang

===========================================

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.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Paddi Rooney 21 Reputation points
    2022-07-18T06:43:25.88+00:00

    Hi,

    i think i may have foundit using your suggestion and another thread

    =IF(OR([document type]="Policy",[document type]="Procedure",[document type]="Rail Form",[document type]="Rail Procedure"),[Date of Review]+365,[Date of Review]+730)

    thank you so much for the help, its much appreciated

    paddi

    Was this answer helpful?

    0 comments No comments

  2. Paddi Rooney 21 Reputation points
    2022-07-18T06:22:35.357+00:00

    Hi,

    thank you for that answer above , so will i be able to use the below command for the 3 document types that i need to be 1 year, everything else by default will be 2 years ?

    =IF([document type]="Policy,Procedures,Rail",[review date]+365,[review date]+730)

    =IF([Document Type]="Policy","Procedures","Rail",[Date of Review]+365,[Date of Review]+730)

    the command will work if i select either individually but i cant get it to run if i input more as above

    thanks

    Was this answer helpful?

    0 comments No comments

Your answer

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