Dateif with Workday

scott11

New Member
Joined
Sep 13, 2016
Messages
33
Hello,

I have the following formula in E2 to calculate the number of days between two dates: =DATEDIF(C2,D2,"D"). However, I want to include the WORKDAY function along with a set of holidays to not calculate. The holidays are in F2:F4. I believe this is what I need in order for cell E2 to calculate only business days, excluding the holidays I have listed.

Thank you.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
60,076
Office Version
  1. 365
Platform
  1. Windows
Thanks, but we have other holiday's that aren't covered by the NETWORKDAYS function
You supply your own list of Holidays with NETWORKDAYS (Excel does not give you any holidays).

Here is another write-up that shows you more explicitly how to set-up and use a holiday list.

It also doesn't return a numerical value when dates are used in the formula.
I have no idea what you mean by this. Can you provide an example?
Note that dates in Excel are actually stored as numbers. So if you are getting a number when you are expecting a date, simple re-format the cell to a date format, and you will see the date in the format you are used to.
 

scott11

New Member
Joined
Sep 13, 2016
Messages
33

ADVERTISEMENT

You supply your own list of Holidays with NETWORKDAYS (Excel does not give you any holidays).

Here is another write-up that shows you more explicitly how to set-up and use a holiday list.


I have no idea what you mean by this. Can you provide an example?
Note that dates in Excel are actually stored as numbers. So if you are getting a number when you are expecting a date, simple re-format the cell to a date format, and you will see the date in the format you are used to.
The DATEDIF formula is returning a number value instead of a date value to show me the number of days that have past between the two dates. NETWORKDAYS doesn't return that value, only a date. So is there a way to combine those two functions to return the number of days between those dates, minus my holidays list? Currently, I get 10 days between 11/16/2020 and 11/27/2020, indicating the DATEDIF function is not accounting for the Thanksgiving holiday.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,728
Office Version
  1. 365
Platform
  1. Windows
NETWORKDAYS doesn't return that value, only a date.
Networkdays returns a number, not a date, you may need to change the cell format.
For those two dates Datedif should return 11
+Fluff v2.xlsm
CDEF
1
216/11/202027/11/20201126/11/2020
3925/12/2020
4
Master
Cell Formulas
RangeFormula
E2E2=DATEDIF(C2,D2,"d")
E3E3=NETWORKDAYS(C2,D2,F2:F3)
 

scott11

New Member
Joined
Sep 13, 2016
Messages
33
Networkdays returns a number, not a date, you may need to change the cell format.
For those two dates Datedif should return 11
+Fluff v2.xlsm
CDEF
1
216/11/202027/11/20201126/11/2020
3925/12/2020
4
Master
Cell Formulas
RangeFormula
E2E2=DATEDIF(C2,D2,"d")
E3E3=NETWORKDAYS(C2,D2,F2:F3)
Ah, I see. Thank you very much!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,728
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 

Forum statistics

Threads
1,147,743
Messages
5,742,929
Members
423,765
Latest member
PaulD1984

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
Top