subtracting dates to count days(no sunday)

jek40

Active Member
Joined
Jan 17, 2005
Messages
317
I am in need of a formula to count the number of days between two dates without counting sundays.

i would prefer not to use networkdays in the formula if possible

thanks
John
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Assuming 1st date in A2, 2nd date in B2.

Try this:

=(B2-A2)-SUM(IF(WEEKDAY(A2-1+ROW(INDIRECT("1:"&TRUNC(B2-A2)+1)))=1,1,0))

Confirm with CTRL-SHIFT-ENTER rather than just Enter.
 
Upvote 0
Or..

=SUMPRODUCT(--(ISNA(MATCH(WEEKDAY(ROW(INDIRECT(A1&":"&A2)),1),{1},0))))

where StartDate in A1 and EndDate in A2

HTH
 
Upvote 0
thanks guys

both work great!!

Krishnakumar -- for some reason I have to subtract 1 from the result to get the total I am looking for but no problem I can make that adjustment.

thanks to both of you for the help

John
 
Upvote 0

Forum statistics

Threads
1,212,928
Messages
6,110,734
Members
448,294
Latest member
jmjmjmjmjmjm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top