IF Statement using Networkdays.intl formula

CapeSable

New Member
Joined
Aug 23, 2019
Messages
2
I am trying to build a formula that will calculate after determining if a start and end date are equal to or between a calendar (fiscal) start and end date.

The formula I have is:
=IF(AND($J$9<=N$4,$K$9>=N$5)*1=1,(N$6*$L$9),IF(AND($J$9<=N$4,$K$9>=N$5)*1=0,IF(AND($J$9<=N$4,$K$9>=N$5)*1=0,(NETWORKDAYS.INTL(N$4,$K$9,1,Holidays)*$L$9),0)))

My worksheet looks like this:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]J[/TD]
[TD="align: center"]K[/TD]
[TD="align: center"]L[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]O[/TD]
[TD="align: center"]P[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]R[/TD]
[TD="align: center"]S[/TD]
[TD="align: center"]T[/TD]
[TD="align: center"]U[/TD]
[TD="align: center"]V[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Fiscal Start[/TD]
[TD]9/20/19[/TD]
[TD]9/28/19[/TD]
[TD]10/1/19[/TD]
[TD]10/26/19[/TD]
[TD]11/1/19[/TD]
[TD]11/23/19[/TD]
[TD]12/1/19[/TD]
[TD]1/1/20[/TD]
[TD]1/25/20[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Fiscal End[/TD]
[TD]9/27/19[/TD]
[TD]9/30/19[/TD]
[TD]10/25/19[/TD]
[TD]10/31/19[/TD]
[TD]11/22/19[/TD]
[TD]11/30/19[/TD]
[TD]12/31/19[/TD]
[TD]1/24/20[/TD]
[TD]1/31/20[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]Net Wrk Days[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]21[/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]75[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]POPS[/TD]
[TD]POPE[/TD]
[TD]Wrk Hrs[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]09/20/19[/TD]
[TD]11/03/19[/TD]
[TD]8[/TD]
[TD]Program Mgr[/TD]
[TD="align: center"]48[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]144[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]-112[/TD]
[TD="align: center"]-144[/TD]
[TD="align: center"]-312[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

The first part of the formula is calculating as desired, however, I am not getting a "0" result once the POP dates are out of range of the fiscal start and end dates.

Can someone please advise how to fix the formula or suggest another formula to get the desired data?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi,

try something like this:


Book1
JKLMNOPQRSTUV
5Fiscal Start20-9-201928-9-20191-10-201926-10-20191-11-201923-11-20191-12-20191-1-202025-1-2020
6Fiscal End27-9-201930-9-201925-10-201931-10-201922-11-201930-11-201931-12-201924-1-202031-1-2020
7Net Wrk Days61184154211675
8POPSPOPEWrk Hrs
920-9-20193-11-20198Program Mgr488144328-112-144-312
104881523280000
Sheet1
Cell Formulas
RangeFormula
N10=IF(OR(N6<$J9,$K9),0,NETWORKDAYS.INTL(MAX($J9,N5),MIN($K9,N6),1,))*$L9
<n5),0,networkdays.intl(max($j9,n5),min($k9,n6),1,holidays))*$l9

<n5),0,networkdays.intl(max($j9,n$5),min($k9;n$6),1, holidays))*$l9<="" html=""></n5),0,networkdays.intl(max($j9,n$5),min($k9;n$6),1,></n5),0,networkdays.intl(max($j9,n5),min($k9,n6),1,holidays))*$l9
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
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