Excel formula in two spots of same work sheet not working properly

kismatta

New Member
Joined
May 29, 2024
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I am using the NETWORKDAYS formula in two separate sections on the same worksheet, however one of them is not calculating properly. Of note, I use the www.timeanddate.com/date/workdays site as a double check method to confirm the calculations with an exclusion of weekends and public holidays in Canada.

Location A formula: =NETWORKDAYS(H22,I22,B76:B158)
From YYYY-MM-DDTo YYYY-MM-DD# of Working Hrs (8hrs/day)# of Working Days
2021-05-182021-08-12480.00060.00

Location B formula: =NETWORKDAYS(B55,C55,B76:B158)
From YYYY-MM-DDTo YYYY-MM-DD# of Working Hrs (8hrs/day)# of Working Days
2023-07-022023-12-31992.000124.00

The # of working days in location B should be 126.

I need to amend the dates in location B to only reflect one day, 2023-07-02, however it gives me a result of 0. So I tried entering 2023-07-02 to 2023-07-03, it still gives me a 0. Only when I enter 2023-07-04 does it calculate, however it gives me an answer of 8.00 (# of working hrs) and 1.00 (# of working days), when it's clearly 2 days.
From YYYY-MM-DDTo YYYY-MM-DD# of Working Hrs (8hrs/day)# of Working Days
2023-07-022023-07-048.0001.00

Any help is greatly appreciated. I'm at a loss as to why the formula does not work properly in both locations.

thank you!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi & welcome to MrExcel.
What dates do you have in B76:B158?

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
Hi & welcome to MrExcel.
What dates do you have in B76:B158?

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.
Hello, and thank you for your prompt response and helpful tips. Unfortunately, I am working on a computer that will not allow me to download add-ons. B76:B158 is a holiday calendar added at the bottom of the sheet.

I am not sure if you are open to me emailing you the spreadsheet or some other method?
 
Upvote 0
Can you just copy/paste the range B76:B158
 
Upvote 0
Can you just copy/paste the range B76:B158
Here is the data:
2020-01-01New Year's Day
2020-04-10Good Friday
2020-04-13Easter Monday
2020-05-18Victoria Day
2020-07-01Canada Day
2020-08-03Civic Holiday
2020-09-07Labour Day
2020-10-12Thanksgiving
2020-11-11Remembrance Day
2020-12-25Christmas Day
2020-12-28Boxing Day (Lieu)
2021-01-01New Year's Day
2021-04-02Good Friday
2021-04-05Easter Monday
2021-05-24Victoria Day
2021-07-01Canada Day
2021-08-02Civic Holiday
2021-09-06Labour Day
2021-09-30Truth & Reconciliation
2021-10-11Thanksgiving
2021-11-11Remembrance Day
2021-12-27Christmas Day (Lieu)
2021-12-28Boxing Day (Lieu)
2022-01-03New Year's Day (Lieu)
2022-04-15Good Friday
2022-04-18Easter Monday
2022-05-23Victoria Day
2022-01-01Canada Day
2022-08-01Civic Holiday
2022-09-05Labour Day
2022-09-30Truth & Reconciliation
2022-10-10Thanksgiving
2022-11-11Remembrance Day
2022-12-26Boxing Day
2022-12-27Christmas Day (Lieu)
2023-01-02New Year's Day (Lieu)
2023-04-07Good Friday
2023-04-10Easter Monday
2023-05-22Victoria Day
2023-07-03Canada Day (Lieu)
2023-08-07Civic Holiday
2023-09-04Labour Day
2022-10-02Truth & Reconciliation (Lieu)
2023-10-09Thanksgiving
2022-11-13Remembrance Day
2023-12-25Christmas Day
2023-12-26Boxing Day (Lieu)
2024-01-01New Year's Day
2024-03-29Good Friday
2024-04-01Easter Monday
2024-05-20Victoria Day
2024-07-01Canada Day
2024-08-05Civic Holiday
2024-09-02Labour Day
2024-09-30Truth & Reconciliation
2024-10-14Thanksgiving
2024-11-11Remembrance Day
2024-12-25Christmas Day
2024-12-26Boxing Day
2025-01-01New Year's Day
2025-04-18Good Friday
2025-04-21Easter Monday
2025-05-19Victoria Day
2025-01-01Canada Day
2025-08-04Civic Holiday
2025-09-01Labour Day
2025-09-30Truth & Reconciliation
2025-10-13Thanksgiving
2025-11-11Remembrance Day
2025-12-25Christmas Day
2025-12-26Boxing Day
2026-01-01New Year's Day
2026-04-03Good Friday
2026-04-06Easter Monday
2026-05-18Victoria Day
2026-01-01Canada Day
2026-08-03Civic Holiday
2026-09-07Labour Day
2026-09-30Truth & Reconciliation
2026-10-12Thanksgiving
2026-11-11Remembrance Day
2026-12-25Christmas Day
2026-12-28Boxing Day (Lieu)
 
Upvote 0
Thanks for that. The reason that the 2nd to the 4th of July return 1 day is that the 2nd is a Sunday & the 3rd is in the list of holidays.
Also you have 6 holiday dates between the 2nd July 23 & the 31st Dec 23, which is why the formula returns 124 days which is correct
 
Upvote 0
Solution
Thank you....I'm so embarrassed I didn't look at it from that perspective. Thank you for pointing that out to me. I think I was expecting a different answer because the leave dates entered are for employees who work weekends too, however our calculation is based on a 40 hr work week, excluding weekends and holidays. So when the leave came back with a "0", it made me think that the calculation wasn't working properly. Other than a manual entry, I am not familiar enough with formulas to know if there is a way to have it account for situations such as this.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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