Add condition to Networkdays formula

Gijs

New Member
Joined
May 29, 2012
Messages
30
The formula I’ve been successfully using to determine the number of weekend days and public holidays of a project, is:
=M13-NETWORKDAYS(K13,L13,'2018 Public holidays'!$C$1:$C$11)
(M13 is the total number of days between K13, the start date and L13 the end date, '2018 Public holidays'!$C$1:$C$11 is the list of public holidays)

This works perfect for one country. In the same formula, I now need to apply the same principle for different countries, based on the public holidays across different countries.

For each row/project, I’ve put the name of the country (USA or UK) in column H and in tab '2018 Public holidays' I’ve the list of public holidays for both countries and added in column '2018 Public holidays'A:A, USA or UK to identify each country’s public holiday date.

How do I add the criteria of column H with the condition of column '2018 Public holidays'A:A into the formula?

Thanks in advance!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Is this what you need?

=M13-NETWORKDAYS(K13,L13,IF('2018 Public holidays'!$A$1:$A$11=H13,'2018 Public holidays'!$C$1:$C$11,))

Note: this is an array formula -- it has to be entered using Ctrl+Shift+Enter, not just Enter.
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,578
Members
449,174
Latest member
chandan4057

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