Network days Help

Spoonyz

New Member
Joined
Apr 12, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi All

Can someone help with a formula for the below? Using the network days formula (=NETWORKDAYS([@[Start date]],[@[End date]],lstHolidays)) it is calculating the amount of days but is there anyway to edit the formula so if the type of leave selected is Vacation HD then the days column shows 0.5 and not 1?

1681310266481.png
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi & welcome to MrExcel.
Should the numbers of days always be half if "Vacation HD" is selected?
 
Upvote 0
Hi & welcome to MrExcel.
Should the numbers of days always be half if "Vacation HD" is selected?
Hi

That is correct, if the type of leave selected is Vacation then days should display the whole number of days but if Vacation HD is selected then this should always be 0.5
 
Upvote 0
Ok, how about
Excel Formula:
=NETWORKDAYS([@[Start date]],[@[End date]],lstHolidays)*(IF([@[Type of leave]]="Vacation HD",0.5,1))
 
Upvote 0
That is still displaying 1 in the days box instead of 0.5

1681312923988.png
 
Upvote 0
Make sure there are no leading/trailing spaces in column E
 
Upvote 0
N.B. The named range cannot have a space.

Workdays.xlsm
ABCDEFG
1
2StartEndVacationVacation_HDVacation
31-Apr-2310-Apr-23232-Apr-23
43-Apr-23
5
6
7Vacation_HD
84-Apr-23
95-Apr-23
106-Apr-23
11
5b
Cell Formulas
RangeFormula
D3D3=SUMPRODUCT(--(ISNUMBER(MATCH(ROW(INDIRECT(B3&":"&C3)),Vacation,0))))
E3E3=SUMPRODUCT(--(ISNUMBER(MATCH(ROW(INDIRECT(B3&":"&C3)),Vacation_HD,0))))
Named Ranges
NameRefers ToCells
Vacation='5b'!$G$3:$G$4D3
Vacation_HD='5b'!$G$8:$G$10E3
 
Last edited:
Upvote 0
A few clear examples with expected results would be helpful.
I do not know if Spoonyz read or tried the suggestions.

I made another guess and to clear the file posted the guess below.

Workdays.xlsm
ABCDEFG
1
2StartEndVacationVacation_HDVacation
31-Apr-2310-Apr-2311.53-Apr-23
41-Apr-2310-Apr-2311.5
5
6Vacation_HD
71-Apr-2310-Apr-232.54-Apr-23
85-Apr-23
96-Apr-23
10
5b
Cell Formulas
RangeFormula
D3D3=SUMPRODUCT(--(ISNUMBER(MATCH(ROW(INDIRECT(B3&":"&C3)),Vacation,0))))*1
E3E3=SUMPRODUCT(--(ISNUMBER(MATCH(ROW(INDIRECT(B3&":"&C3)),Vacation_HD,0))))*0.5
D4D4=NETWORKDAYS(B4,C4)-NETWORKDAYS(B4,C4,Vacation)
E4E4=(NETWORKDAYS(B4,C4)-NETWORKDAYS(B4,C4,Vacation_HD))*0.5
D7D7=LET(w,NETWORKDAYS(B7,C7),w-NETWORKDAYS(B7,C7,Vacation)+(w-NETWORKDAYS(B7,C7,Vacation_HD))*0.5)
Named Ranges
NameRefers ToCells
Vacation='5b'!$G$3:$G$3D7, D3:D4
Vacation_HD='5b'!$G$7:$G$9E3:E4, D7
 
Upvote 0

Forum statistics

Threads
1,216,175
Messages
6,129,312
Members
449,499
Latest member
HockeyBoi

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