• pavani etukuru 9
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Here is my Requirement, 
Create a formula field that classifies an Opportunity as either “Early”, “Middle”, or “Late”. This formula field should use TODAY() to calculate what percentage of the time between an opportunity’s CreatedDate and CloseDate has passed, and label the opportunity accordingly.
This formula should be on the Opportunity object
This formula should be named 'Opportunity Progress' with the resulting API name Opportunity_Progress__c
This formula should return 'Early' if less than or equal to 25% of an opportunity has passed
This formula should return 'Middle' if between 25% and 75% of an opportunity has passed
This formula should return 'Late' if more than 75% of an opportunity has passed
This formula should reference a helper formula field, also on the Opportunity Object, with the type Percent and the name Percent Completed
Percent Completed should return the percentage of the time that has passed between an opportunity’s CreatedDate and CloseDate



here is my code:
IF
(TODAY() -  DATEVALUE(createdDate)) / (CloseDate - Datevalue(createdDate)) <= 0.25,"Early",
 
IF(AND(
(TODAY() -  DATEVALUE(createdDate))/(CloseDate-Datevalue(createdDate))>0.25,
(TODAY() -  DATEVALUE(createdDate))/(CloseDate-Datevalue(createdDate))<=0.75), "Middle",

IF(TODAY() -Datevalue(createdDate))/(CloseDate-Datevalue(createdDate))>0.75, "Late", Null)))