# Field Formula for Soonest Date After X Amount of Days

I'm trying to create a couple of fields to calculate the eligibility date for employee benefits.

-The first one should return a date of either the 1st or the 15th of the month 60 days after Hire Date. It would need to determine which date is soonest after the 60 days. For example, a hire date of 12/7/2022 would return the result 2/15/2023 while a hire date of 12/15/2022 would return the result of 3/1/2022

-The second one would be the same concept except the return dates would be either the 15th or the last day of the month.

Is this even something that can be done with a formula field?

I have a temporary formula in as a placeholder while I build everything out. It's set to return the 1st of the month after 60 days and is working as expected. I just found out that we needed the 15th as well and I don't know where to go from here.

``````DATE(IF(MONTH(Employee_ID__r.Date_of_Hire__c +60) = 12,
YEAR(Employee_ID__r.Date_of_Hire__c +60)+1,
YEAR(Employee_ID__r.Date_of_Hire__c +60)),
IF(MONTH(Employee_ID__r.Date_of_Hire__c +60)=12, 1,
MONTH(Employee_ID__r.Date_of_Hire__c +60)+1), 1)
``````
• welcome to SFSE! Please see How to Ask on getting the most from the Community -- yes, it can be done -- what have you tried? Commented Dec 7, 2022 at 17:42
• @cropredy I have a temporary formula in as a placeholder while I build everything out. It's set to return the 1st of the month after 60 days and is working as expected. I just found out that we needed the 15th as well and I don't know where to go from here. DATE(IF(MONTH(Employee_ID__r.Date_of_Hire__c +60) = 12, YEAR(Employee_ID__r.Date_of_Hire__c +60)+1, YEAR(Employee_ID__r.Date_of_Hire__c +60)), IF(MONTH(Employee_ID__r.Date_of_Hire__c +60)=12, 1, MONTH(Employee_ID__r.Date_of_Hire__c +60)+1), 1) Commented Dec 7, 2022 at 17:50
• @Moonpie Apologies, I have edited my original post to include the additional information. Commented Dec 8, 2022 at 3:27
• This question seems eerily similar to this recent question: salesforce.stackexchange.com/q/391524/81648.... Commented Dec 8, 2022 at 3:37

``````IF (DAY(Employee_ID__r.Date_of_Hire__c) < 15,