Month end formula with an if then

Mariyka1

New Member
Joined
Nov 1, 2016
Messages
44
Hello,
I have this formula so far - I need it to look at the dates field, and say if the date is a month end date then to put a number 5, if not a month end date then to do a networkdays formula. I have this formula - although it is not working and giving errors.
any insight is appreciated

=IF(H39=EOMONTH($A6,0),5,NETWORKDAYS(B2,A6,Holidays!$E$8:$E$17))




[TABLE="width: 108"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Report_Prd[/TD]
[/TR]
[TR]
[TD]1/5/2018[/TD]
[/TR]
[TR]
[TD]1/12/2018[/TD]
[/TR]
[TR]
[TD]1/19/2018[/TD]
[/TR]
[TR]
[TD]1/26/2018[/TD]
[/TR]
[TR]
[TD]1/31/2018[/TD]
[/TR]
[TR]
[TD]2/2/2018[/TD]
[/TR]
[TR]
[TD]2/9/2018[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
According to your formula, what do you have in cell H39 and what in cell A6?
 
Upvote 0
=IF(A6=(EOMONTH($A6,0)),5,(NETWORKDAYS(A6-WEEKDAY(A6,2),A6,Holidays!$E$8:$E$17)))

the H39 was a typo. I have the above formula. A6 is the date 1/5/2018. I need it to count networking days from that previous Monday, excluding the holiday list I have .although it doesn't seem to be working.
 
Upvote 0
I need it to count networking days from that previous Monday, excluding the holiday list


If you have 1/5/2019 the previous Monday is 12/31/2018, if the 1/1/2019 is holiday then it is 4 working days

Use the next formula:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Formula[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]=NETWORKDAYS(A6-WEEKDAY(A6,2)+1,A6,Holidays!E8:E17)[/TD]
[/TR]
</tbody>[/TABLE]



Now, if you want to put the condition if the date in A6 is the end of the month, then:

[TABLE="class: grid, width: 800"]
<tbody>[TR]
[TD][/TD]
[TD]Formula[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]=IF(A6=​EOMONTH($A6,0),5,NETWORKDAYS(A6-WEEKDAY(A6,2)+1,A6,Holidays!E8:E17))[/TD]
[/TR]
</tbody>[/TABLE]



Try and tell me.

 
Upvote 0

Forum statistics

Threads
1,223,713
Messages
6,174,041
Members
452,542
Latest member
Bricklin

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