# count workdays

#### Ron Morris

##### Active Member
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?)

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.

You will need to install the analysis toolpak for this:

=NETWORKDAYS(A1,A2)

=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

Use the NETWORKDAYS function. For accuracy, create a separate table of holidays, and subtract any holidays from the total.

Denis

Guys - I think we have consensus on this issue (lol).

Hey Taz,

Thanks alot, I didn't think it was going to be that easy!

Ron

Replies
4
Views
218
Replies
11
Views
638
Replies
1
Views
142
Replies
12
Views
416
Replies
3
Views
283

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.

### Which adblocker are you using?

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

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