I have a Trades table and it has a date column - Trades[Date]. The dates are sequential from top to bottom. Looking for a formula to use outside of the table that will return the number of workdays in the Date column.
Excellent use of the Subtotal, Cubist.Try:
Excel Formula:=NETWORKDAYS.INTL(SUBTOTAL(105,Trades[Date]),SUBTOTAL(104,Trades[Date]))
Looks perfect. Thank You.Try:
Excel Formula:=NETWORKDAYS.INTL(SUBTOTAL(105,Trades[Date]),SUBTOTAL(104,Trades[Date]))
Cubist provided the perfect solution for you. See his post. I was testing it with your original Samle Data and it produces the correct results, even when you apply a filter to the Date column.Thank you for this. It is the solution for the entire column. I wonder if anyone will come up with a way to the count the networkdays from a filtered data set.
Had to help my kid with a gift... and I come back to finalize my post... and you beat me to the punch!Looks perfect. Thank You.
Looks like you got yourself a pretty solid solution. One thing I would recommend is formatting your list of blackout dates (Holidays) as a Table so you don't run into any issues as that list grows/shrinks.Final with Weekend and Holidays thru 2030:
Excel Formula:=NETWORKDAYS.INTL(SUBTOTAL(105,Trades[Date]),SUBTOTAL(104,Trades[Date]),1,V6:V82)
VBA Testing.xlsm | |||
---|---|---|---|
D | |||
1 | Date | ||
2 | 2024-12-24 | ||
3 | 2024-12-25 | ||
4 | 2025-01-01 | ||
Count |
=NETWORKDAYS.INTL(SUBTOTAL(105,Trades[Date]),SUBTOTAL(104,Trades[Date]),1,[I]Holidays[Date][/I])