Count workdays between the first and last dates in a table column.

vanwooten

Board Regular
Joined
Dec 15, 2020
Messages
60
Office Version
  1. 365
Platform
  1. Windows
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.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
How about posting some sample data and a mocked up solution for 8-10 records. Please use XL2BB and no pictures as we cannot manipulate data in pictures.
 
Upvote 0
Table below. I am looking for the workday function syntax that would return the number of workdays in the list.

Book1
CDE
3Date???
412/18/2024
512/19/2024
612/20/2024
712/21/2024
812/22/2024
912/23/2024
1012/24/2024
1112/25/2024
1212/26/2024
1312/27/2024
1412/28/2024
1512/29/2024
1612/30/2024
1712/31/2024
181/1/2025
Sheet1
 
Upvote 0
I should add that the list will be filtered and I am looking to return the workdays in filtered and unfiltered states.
 
Upvote 0
I should add that the list will be filtered and I am looking to return the workdays in filtered and unfiltered states.
Filter how? Post complete question and data set.
 
Upvote 0
I am confused. What two dates are you comparing? Your request is lacking information necessary to respond.
 
Upvote 0
The table has a series of dates. Let's assume that they are in ascending order. The table will at times be filtered to show only 1 day or a subset of days. I am looking for a formula for outside of the table that would essentially combine a Subtotal function with the Networkdays function or something else to that effect.. It would give workdays for the displayed data either filtered or unfiltered.

Book1.xlsx
CDE
3Date???
412/18/2024
512/19/2024
612/20/2024
712/21/2024
812/22/2024
912/23/2024
1012/24/2024
1112/25/2024
1212/26/2024
1312/27/2024
1412/28/2024
1512/29/2024
1612/30/2024
1712/31/2024
181/1/2025
Sheet1
 
Upvote 0
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.
Hi vanwooten,

I use a similar formula for counting the remaining number of student Test Days… which only fall on weekdays.

This should get you started considering you mentioned you'll be using this formula outside of a table. However, since the dates are in the Table, you'll use Table references to count the dates. It shouldn't matter where you place this formula in your Workbook, it will return the correct number of days. If you want it inside of a Table, it's best suited in the Totals Row, else you'll have a column with all the same values.

Note: The Holiday switch is optional. If you have a list of dates that are Holidays, or some general blackout dates, just add that range into the Holiday portion of the formula so it doesn't count those dates.

VBA Testing.xlsm
AB
1DateDay
22024-12-18WED
32024-12-19THU
42024-12-20FRI
52024-12-21SAT
62024-12-22SUN
72024-12-23MON
82024-12-24TUE
92024-12-25WED
102024-12-26THU
112024-12-27FRI
122024-12-28SAT
132024-12-29SUN
142024-12-30MON
152024-12-31TUE
162025-01-01WED
Sheet1
Cell Formulas
RangeFormula
B2:B16B2=UPPER(TEXT(A2,"ddd"))


VBA Testing.xlsm
A
18n Days
1911
20
21Start Date
222024-12-18
23
24End Date
252025-01-01
26
27Formula:
28=NETWORKDAYS(start_date, end_date, [holidays])
Sheet1
Cell Formulas
RangeFormula
A19A19=NETWORKDAYS(MIN(t_Trades[Date]),MAX(t_Trades[Date]))
A22A22=MIN(t_Trades[Date])
A25A25=MAX(t_Trades[Date])


Best regards,
 
Upvote 0
Hi vanwooten,

I use a similar formula for counting the remaining number of student Test Days… which only fall on weekdays.

This should get you started considering you mentioned you'll be using this formula outside of a table. However, since the dates are in the Table, you'll use Table references to count the dates. It shouldn't matter where you place this formula in your Workbook, it will return the correct number of days. If you want it inside of a Table, it's best suited in the Totals Row, else you'll have a column with all the same values.

Note: The Holiday switch is optional. If you have a list of dates that are Holidays, or some general blackout dates, just add that range into the Holiday portion of the formula so it doesn't count those dates.

VBA Testing.xlsm
AB
1DateDay
22024-12-18WED
32024-12-19THU
42024-12-20FRI
52024-12-21SAT
62024-12-22SUN
72024-12-23MON
82024-12-24TUE
92024-12-25WED
102024-12-26THU
112024-12-27FRI
122024-12-28SAT
132024-12-29SUN
142024-12-30MON
152024-12-31TUE
162025-01-01WED
Sheet1
Cell Formulas
RangeFormula
B2:B16B2=UPPER(TEXT(A2,"ddd"))


VBA Testing.xlsm
A
18n Days
1911
20
21Start Date
222024-12-18
23
24End Date
252025-01-01
26
27Formula:
28=NETWORKDAYS(start_date, end_date, [holidays])
Sheet1
Cell Formulas
RangeFormula
A19A19=NETWORKDAYS(MIN(t_Trades[Date]),MAX(t_Trades[Date]))
A22A22=MIN(t_Trades[Date])
A25A25=MAX(t_Trades[Date])


Best regards,
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.
 
Upvote 0
Try:
Excel Formula:
=NETWORKDAYS.INTL(SUBTOTAL(105,Trades[Date]),SUBTOTAL(104,Trades[Date]))
 
Upvote 1
Solution

Forum statistics

Threads
1,225,623
Messages
6,186,065
Members
453,336
Latest member
Excelnoob223

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