You need to sign in to do that
Don't have an account?
Denise Meinershagen
Need Help With Formula Field
I'm trying to calculate the current FY potential revenue by looking at the Product Close Date (date field) and the the Product Probablity % (text field). Then I have a formula that does the math. I have the formula that does the math working as needed. So what I need help with is the AND/IF statement (if that is even correct to use that statement).
Here is the error message I receive:
Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 4
Here is the code:
IF(YEAR(TODAY()) = YEAR(Product_Close_Date__c),
AND(IF( Product_Probability__c, "10%",
(TotalPrice / 12) * 0.10 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "15%",
(TotalPrice / 12) * 0.15 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "20%",
(TotalPrice / 12) * 0.20 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "40%",
(TotalPrice / 12) * 0.40 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "75%",
(TotalPrice / 12) * 0.75 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "100%",
(TotalPrice / 12) * 0.100 * (13 - (MONTH(Product_Close_Date__c))),
0)))))))))))))
Here is the error message I receive:
Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 4
Here is the code:
IF(YEAR(TODAY()) = YEAR(Product_Close_Date__c),
AND(IF( Product_Probability__c, "10%",
(TotalPrice / 12) * 0.10 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "15%",
(TotalPrice / 12) * 0.15 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "20%",
(TotalPrice / 12) * 0.20 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "40%",
(TotalPrice / 12) * 0.40 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "75%",
(TotalPrice / 12) * 0.75 * (13 - (MONTH(Product_Close_Date__c))),
AND(IF( Product_Probability__c, "100%",
(TotalPrice / 12) * 0.100 * (13 - (MONTH(Product_Close_Date__c))),
0)))))))))))))
Try replacing all those AND/IFs with CASE like below :
And see if that works.
Note: Mark this as solution if it helps!
Cheers,
KVin
All Answers
Try replacing all those AND/IFs with CASE like below :
And see if that works.
Note: Mark this as solution if it helps!
Cheers,
KVin
Hope that helps you figure out what you looking for .
Good luck!