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
Guilherme Eduardo de FariasGuilherme Eduardo de Farias 

Error in formula field

Hello,

I have a formula field with the formula below:

(5 * ( FLOOR((Start_Date__c- DATE(1900,1, 8) ) / 7 ) ) + MIN(5, MOD(Start_Date__c- DATE(1900,1, 8), 7 ) ) )
-
(5 * ( FLOOR((End_Date__c- DATE(1900,1, 8) ) / 7 ) ) + MIN(5, MOD(End_Date__c- DATE(1900,1, 8), 7 ) ) )

I need to separate only the working days between these dates, and put in showing in the field formulates the result, but it is giving the following error

Error: Formula result is data type (Number), incompatible with expected data type (Date).
Best Answer chosen by Guilherme Eduardo de Farias
SteveMo__cSteveMo__c
Can you post a complete screenshot of the Formula Field and the error message?  It sounds like you just selected 
Datatype = Formula
Result = Date 
instead of selecting Result = Number

All Answers

SteveMo__cSteveMo__c
Can you post a complete screenshot of the Formula Field and the error message?  It sounds like you just selected 
Datatype = Formula
Result = Date 
instead of selecting Result = Number
This was selected as the best answer
SteveMo__cSteveMo__c
Yeah, that's exactly what I said.  You need to select Result = Number
Guilherme Eduardo de FariasGuilherme Eduardo de Farias
Sorry, I still can't understand
SteveMo__cSteveMo__c
When you created the Field you selected DATE as the result type (that's won't work) you need to change the Result Type to NUMBER