function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SherriASherriA 

Formula to forecast based on multiple date and probability criteria?

I need to create a formula that determines if an opportunity is forcasted or not.  An opportunity would be considered forecasted if the close date is this month AND the probability is 70% or greater OR the close date is next month or the month after AND the probability is 50% or greater.  One of these days I'll get better at writing formulas (and I really am trying!) but until then any help would be greatly appreciated.  

 

Here's what I've got so far but I'm still getting the dreaded syntax errors:  

 

 

IF(
OR(
AND(CloseDate =MONTH(Today()),  Probability >=70)
AND(
OR(CloseDate= (Month(Today())+1), (CloseDate=(Month(Today())+2)),
Probability>=50))
"Forecast", null)))

IF(

OR(

AND(CloseDate =MONTH(Today()),  Probability >=70)

AND(

OR(CloseDate= (Month(Today())+1), (CloseDate=(Month(Today())+2)),

Probability>=50))

"Forecast", null)))

 

Best Answer chosen by Admin (Salesforce Developers) 
tantotanto

Try this:

 

IF(
OR(
AND(
MONTH(CloseDate) =MONTH(Today()),
Probability >=0.7
),
AND(
OR(
MONTH(CloseDate)= (Month(Today())+1),
MONTH(CloseDate)=(Month(Today())+2)
),
Probability>=0.5)
),
"Forecast", "")

All Answers

tantotanto

What is the syntax error?

tantotanto

Try this:

 

IF(
OR(
AND(
MONTH(CloseDate) =MONTH(Today()),
Probability >=0.7
),
AND(
OR(
MONTH(CloseDate)= (Month(Today())+1),
MONTH(CloseDate)=(Month(Today())+2)
),
Probability>=0.5)
),
"Forecast", "")

This was selected as the best answer
SherriASherriA

That worked!  Thanks for the help!

 

-- Sherri