+ Start a Discussion
janeisaacjaneisaac 

AND formula with IF Statement with extra comma syntax error

I am getting a Syntax error that says there is an extra comma at the end of the second row in the formula below
I need the formula to check if the first two fields are blank and if they are, use the first solution, otherwise use the second.

IF((AND
   (ISBLANK(Date_Decisioned__c ))),(ISBLANK(Returned_to_Sales_for_Credit_Follow_up__c))),
(TODAY() - (DATEVALUE(Submitted_to_Credit__c))),
(DATEVALUE( Returned_to_Sales_for_Credit_Follow_up__c ))-(DATEVALUE(Submitted_to_Credit__c )))
Best Answer chosen by janeisaac
Ketankumar PatelKetankumar Patel
Hi Janeisaac try this, 
 
IF( 
     AND( 
	       ISBLANK(Date_Decisioned__c),
	       ISBLANK(Returned_to_Sales_for_Credit_Follow_up__c)
	     ), 
     TODAY() - (DATEVALUE(Submitted_to_Credit__c)),
     DATEVALUE(Returned_to_Sales_for_Credit_Follow_up__c)- DATEVALUE(Submitted_to_Credit__c)	 
  )

 

All Answers

Ketankumar PatelKetankumar Patel
Hi Janeisaac try this, 
 
IF( 
     AND( 
	       ISBLANK(Date_Decisioned__c),
	       ISBLANK(Returned_to_Sales_for_Credit_Follow_up__c)
	     ), 
     TODAY() - (DATEVALUE(Submitted_to_Credit__c)),
     DATEVALUE(Returned_to_Sales_for_Credit_Follow_up__c)- DATEVALUE(Submitted_to_Credit__c)	 
  )

 
This was selected as the best answer
janeisaacjaneisaac
Thank you @Ketankumar Patel - that worked!