NETWORKDAYS vs COUNTIFS

amberd

New Member
Joined
Mar 13, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have a calendar created in Excel and conditional formatting to highlight certain days between 2 separately input dates at the top. On the far right I am wanting to count the number of network days within a row, but ONLY if they are between the "1st day of Leave" and "Last Day" at the top.

I have formulas that show the network days for each row (excluding my holidays), and the number of total days in each row that are included within those dates, but can't figure out how to do both at the same time. Below are the formulas I currently have for those 2 columns (in the January row).

=IF(AF6="",NETWORKDAYS(B6,AE6,'Holiday List'!$A$2:$A$15),NETWORKDAYS(B6,AF6,'Holiday List'!$A$2:$A$15))

=COUNTIFS(B6:AF6,">="&$O$2,B6:AF6,"<="&$Y$3)

1710360676530.png
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
What do you mean by "do both at the same time" ? In the same cell? Or something else? What is the desired result?
 
Upvote 0
I figured it out. Below is the formula I used in the January row for anyone else that it can help.

The previous ways counted only network days in the row, OR only ALL days in the row within the 2 dates at the top. The below counts network days within the row, but ONLY if they are within the 2 dates at the top.

=MAX(0,NETWORKDAYS(MAX(B6,$O$2),MIN(DATE(YEAR(B6),MONTH(B6)+1,0),$Y$3),'Holiday List'!$A$2:$A$15))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

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