count workdays

Ron Morris

Active Member
Joined
Oct 18, 2004
Messages
430
Hi,

Wanting to know if this is possible in either Excel or VBA.

I need to enter a start date in A1 - say 2/2/05
I need to enter an end date in A2 - say 2/7/05

In A3 I want to display the number of weekdays (or workdays). In this case, the number 3, based on the two dates provided.

Thank you,

Ron
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Can you use the NETWORKDAYS() funtion? You have to install the Analysis Toolpak for this, though.

(And wouldn't the correct answer be 4?)
 
Upvote 0
Ron Morris said:
Hi,

Wanting to know if this is possible in either Excel or VBA.

I need to enter a start date in A1 - say 2/2/05
I need to enter an end date in A2 - say 2/7/05

In A3 I want to display the number of weekdays (or workdays). In this case, the number 3, based on the two dates provided.

Thank you,

Ron

=NETWORKDAYS(A1,A2,Holidays)

where A1 <= A2 and Holidays (optional) refers to a range of holiday dates.

The function requires the Analysis Toolpak add-in.
 
Upvote 0
You will need to install the analysis toolpak for this:

=NETWORKDAYS(A1,A2)
 
Upvote 0
=NETWORKDAYS(A1,A2,Holidays)
which needs the analysis tool pack addin turned on

Also with your data that will give an answer of 4 Wed,Thur, Fri & Monday as it is inclusive if you need the answer to be 3 just add a minus 1

Hope that helps
 
Upvote 0
Use the NETWORKDAYS function. For accuracy, create a separate table of holidays, and subtract any holidays from the total.

Denis
 
Upvote 0

Forum statistics

Threads
1,203,619
Messages
6,056,323
Members
444,859
Latest member
nil164

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