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
Chelsey DietzChelsey Dietz 

Multiple IF functions

Hello, 

 

I need help with a IF formula. I am attempting to calculate the number of times a patron has participated in an activity within our organization. 

 

Right now I am using the formula below to calculate how many people within a report have donated since joining. 

 

IF(Group_Roster__c.eGroup_Join_Date__c > Contact.npo02__FirstCloseDate__c, 0, 1)

 

This formula is working. However I want to take it a step further by also calculating how many people have given, served at an event. Basically I am trying to combine two IF formulas together but I keep getting an error saying there are too many IF functions. 

IF(Group_Roster__c.eGroup_Join_Date__c < Contact.npo02__FirstCloseDate__c,0, 1)IF(Group_Roster__c.eGroup_Join_Date__c < Contact.GW_Volunteers__First_Volunteer_Date__c,0, 1)

Is it possible to combine two IF functions and if not is there another way I can do this? I am trying to calculate the number of people who took an additional step of participating within our organization after joining.

Any advice woud be appreciated!


 
VinayVinay (Salesforce Developers) 
Hi Cheslsey, 

Try below formula.
 
IF((Group_Roster__c.eGroup_Join_Date__c < Contact.npo02__FirstCloseDate__c), 0), 
IF((Group_Roster__c.eGroup_Join_Date__c < Contact.GW_Volunteers__First_Volunteer_Date__c), 0),
1)

Please mark as Best Answer if above information was helpful.

Thanks,
Chelsey DietzChelsey Dietz
OK that seemed to work but now I am gettign an error that says "Warning
Error when encoding row-level formula: Syntax error. Extra IF"

Is there a way to have two IF functions in a SF formula? Or do I need to try this in classic vs lighting? 
TobyKutlerTobyKutler
Should be like this, the above had extra parentheses.
 
 IF((Group_Roster__c.eGroup_Join_Date__c < Contact.npo02__FirstCloseDate__c), 0, IF((Group_Roster__c.eGroup_Join_Date__c < Contact.GW_Volunteers__First_Volunteer_Date__c), 0, 1)

That is how you put multiple if conditions in a formula. The IF has three parameters the decision, the outcome if true, and the outcome if false. You can use another IF condition as either of the two outcomes.