# Calculate business days between two dates

I'm trying to create a formula that would calculate the business days between "Claim Filled/Submitted Date" and "Date/Time Closed" for claims turn time. I'm using the formula:

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


However, I'm not sure how to replace date_1 and date_2 with the fields I want. I keep getting an error saying the custom field doesn't exist.

• Which object are you trying to create the formula on? Which fields?
– Kyle
Jun 4, 2018 at 19:18
• The fields are the "Claim Filled/Submitted Date" and "Date/Time Closed" for Cases. I'm creating the formula for a summary report since I don't have access to the Formula Editor. Jun 4, 2018 at 19:31
• Here's an example of what I've tried: (5 * ( FLOOR( ( ClosedDate - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( ClosedDate - DATE( 1900, 1, 8), 7 ) ) ) - (5 * ( FLOOR( ( Claim_Filed_Date__c - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( Claim_Filed_Date__c - DATE( 1900, 1, 8), 7 ) ) ) Jun 4, 2018 at 19:43
• If you're using ClosedDate from the Case Object, that's a Date-Time field and you'll need to get the DateValue of it. That's likely why it's not working for you. Jun 4, 2018 at 19:47
• Even after trying to find the DateValue of it, the same error occurs: Field ClosedDate does not exist. Jun 4, 2018 at 20:22

(5 * FLOOR( ( DATEVALUE(ClosedDate) - DATE( 1900, 1, 8) ) / 7 )
{"ft_lang_label":"__label__en","ft_lang_prob":0.8256644,"math_prob":0.7936708,"size":915,"snap":"2023-40-2023-50","text_gpt3_token_len":354,"char_repetition_ratio":0.1909989,"word_repetition_ratio":0.42051283,"special_character_ratio":0.45355192,"punctuation_ratio":0.17777778,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9820577,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-06T18:48:32Z\",\"WARC-Record-ID\":\"<urn:uuid:bd5a8470-db14-44be-8982-881ea84aabd6>\",\"Content-Length\":\"149596\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6d2c6cdb-6246-40e3-a11c-ae896b2cc459>\",\"WARC-Concurrent-To\":\"<urn:uuid:538b6f91-ea94-488e-8612-0518abf53fdf>\",\"WARC-IP-Address\":\"104.18.43.226\",\"WARC-Target-URI\":\"https://salesforce.stackexchange.com/questions/220412/calculate-business-days-between-two-dates\",\"WARC-Payload-Digest\":\"sha1:ZPIV2Y6XB46JQ5VU5S25TWQVSUPOHTJN\",\"WARC-Block-Digest\":\"sha1:SAVH6DDB234EXFCMZBFNMIQT7XET2LKY\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100602.36_warc_CC-MAIN-20231206162528-20231206192528-00543.warc.gz\"}"}