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
suchitra moilla 1suchitra moilla 1 

Formula Field Error :IF() Expected Date, received Number

Hi,

I need to create a new field “Evaluation duration” which is number of days between “Evaluation received date” and “Application to evaluator” fields.  If “Evaluation received date” is null, it should be set as today date in the formula. 

I have used this formula 
IF((ISBLANK(Evaluation_received_date__c)),TODAY(),Evaluation_received_date__c - Application_to_evaluator__c)

But got this Incorrect parameter type for function 'IF()'. Expected Date, received Number

Any thoughts would be of great help.
 
Best Answer chosen by suchitra moilla 1
OhtomoOhtomo
Because TODAY() is date type and "Evaluation_received_date__c - Application_to_evaluator__c" is number type. 

IF you want, I recommend to choose text from costom field type ,and formula
IF((ISBLANK(Evaluation_received_date__c)),TEXT(TODAY()),TEXT(Evaluation_received_date__c - Application_to_evaluator__c))

Please excuse me if you may not understand or you feel bad with my poor English.

All Answers

OhtomoOhtomo
Because TODAY() is date type and "Evaluation_received_date__c - Application_to_evaluator__c" is number type. 

IF you want, I recommend to choose text from costom field type ,and formula
IF((ISBLANK(Evaluation_received_date__c)),TEXT(TODAY()),TEXT(Evaluation_received_date__c - Application_to_evaluator__c))

Please excuse me if you may not understand or you feel bad with my poor English.
This was selected as the best answer
suchitra moilla 1suchitra moilla 1
Thank you Ohtomo.That worked!