I've been trying to work this out for 2 days and I'm probably overcomplicating this but here's what I'd like to do.
If the employee has been employed >= 2 years they only need to take certain classes annually, and one class every three years. If employed less than 2 years, one of the courses is annual instead.
Hired is a date column. Courses is a choice column of class options. Last Taken is the date the course was last taken. The calculated column Next Due, showing the next due date after inputting the class and date the employee took it. I did have minor success with IF(OR but not having success with the below. I tried to figure it out in Excel but I'm unable to build the formula there. Today is a column for the current date. I can either use a workflow to update daily or I can delete it after getting my formula right to trick SP (I've done both).
=IF(Today>=DATE(YEAR([Hired])+2,MONTH([Hired]),DAY([Hired])),
IF([Courses]="Class1",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken]))),
IF([Courses]="Class2",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken]))),
IF([Courses]="Class3",DATE(YEAR([Last Taken])+3,MONTH([Last Taken]),DAY([Last Taken]))))
The part below is if employed less than 2 years. It's just part of the code I lifted out of what I've been working on. I know the syntax is incorrect but no matter what I do (if I join them, use OR, use AND) it's just not working.
IF([Courses]="Class1",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken]))),
IF([Courses]="Class2",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken]))),
IF([Courses]="Class3",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken]))))
I don't know how to get it all to work. And I do use Notepad++ and check my brackets but it's fruitless. Can someone help?
Thanks in advance!
Edited to add this new section
=IF(Today() >= DATE(YEAR([Hired])+2,MONTH([Hired]),DAY([Hired])),
IF([Courses]="Class1",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken])),
IF([Courses]="Class2",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken])),
IF([Courses]="Class3",DATE(YEAR([Last Taken])+3,MONTH([Last Taken]),DAY([Last Taken])),"")))),
//need this section also - how to integrate with above?
IF(Today() <= DATE(YEAR([Hired])+2,MONTH([Hired]),DAY([Hired])),
IF([Courses]="Class1",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken])),
IF([Courses]="Class2",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken])),
IF([Courses]="Class3",DATE(YEAR([Last Taken])+1,MONTH([Last Taken]),DAY([Last Taken])),""))))