Count days as follows: include weekend, exclude holidays, but if holiday day is on weekend then don't count the weekend day

keidla

New Member
Joined
Feb 4, 2022
Messages
8
Office Version
  1. 2021
I have a good formula and it works very well, except if holiday is on weekend it should not be counted.

=F6-E6+1+NETWORKDAYS(F6;E6)-NETWORKDAYS(F6;E6;sheet1!$A$2:$A$13)
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi & welcome to MrExcel.

Can you post some sample data, along with expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
I have a vacation period, that needs to be calculated as follows: weekends are included to the period, holidays not included. But if holiday is on weekend then it should be a free day and not be counted. There is a contradiction between the holiday day and weekend day. For holiday days I have new sheet (pühad!)

1644217151156.png
 

Attachments

  • 1644217065207.png
    1644217065207.png
    12.2 KB · Views: 6
  • 1644217117159.png
    1644217117159.png
    12.2 KB · Views: 6
Upvote 0
I have a vacation period, that needs to be calculated as follows: weekends are included to the period, holidays not included. But if holiday is on weekend then it should be a free day and not be counted. There is a contradiction between the holiday day and weekend day. For holiday days I have new sheet (pühad!) First road solution is 7 days, which is correct answer. Second one should be 3 days, but since 20.08 is a holiday, then it is counted as a weekend day.
 
Last edited by a moderator:
Upvote 0
Ok, how about
Excel Formula:
=NETWORKDAYS(E6,F6,Sheet1!$A$2:$A$13)+NETWORKDAYS.INTL(E6,F6,"1111100")
 
Upvote 0
Ok, how about
Excel Formula:
=NETWORKDAYS(E6,F6,Sheet1!$A$2:$A$13)+NETWORKDAYS.INTL(E6,F6,"1111100")
Sorry, but it's not working. Still the same result, does not count the day off when holiday is on weekend.
 
Upvote 0
does not count the day off when holiday is on weekend.
But you said
But if holiday is on weekend then it should be a free day and not be counted.
Which is exactly what the formula I suggested does.

Please post some sample data from both sheets showing expected results, using the XL2BB add-in rather than an image.
 
Upvote 0
"weekends are included to the period, holidays not included. But if holiday is on weekend then it should be a free day and not be counted."
This sounds like all days are counted, except for holidays. Whether a day is on the weekend or not, it is counted only if it is not a holiday.
 
Upvote 0
If you simply want to count all days without holidays, then try
Excel Formula:
=NETWORKDAYS.INTL(E6,F6,"0000000",Sheet1!$A$2:$A$13)
 
Upvote 0
Solution

Forum statistics

Threads
1,216,096
Messages
6,128,809
Members
449,468
Latest member
AGreen17

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