Get networkdays to work on a concatenate date and time entry

rugby_nut

New Member
Joined
Jan 13, 2009
Messages
42
Hi all,

I have a sheet where a user would manually input a date in one cell and a time in another adjacent cell. I have used concatenate to pull these together in another cell. Using networkdays I cannot get the formula to calculate the difference between the date/times and return day(s), hour(s) and min(s).
If I manually type the date and time, the networkdays function works, it's only when trying to use the concatenate formula it all goes sideways.
Any help would be great.
Additionally, It would be great to learn of any quicker ways for a user to input a date and time to maintain a standardised input.

I've attached the sheet I'm working on. Thank you...

Book1
ABCDEFGHIJKLMNO
1Manual entryManual entry=NETWORKDAYS(E4,J4)+MOD(J4-E4,1)-1=INT(K4)& " days "& HOUR(K4) &" hrs "& MINUTE(K4) &" mins"
2Tue 17/12/2019 10:14Sun 22/12/2019 14:323.1791666673 days 4 hrs 18 mins
3Mon 09/12/2019 10:14Mon 09/12/2019 15:140.2083333330 days 5 hrs 0 minsLongestShortest
4Mon 09/12/2019 18:14Tue 10/12/2019 15:14Sun 01/01/1900 21:001 days 21 hrs 0 mins3 days, 4 hours0 days, 5 hours
5
6User inputUser input=CONCATENATE(TEXT(A2,"ddd dd/mm/yy")&" "&TEXT(B2,"hh:mm"))User inputUser input=CONCATENATE(TEXT(F1,"ddd dd/mm/yy")&" "&TEXT(G1,"hh:mm"))=NETWORKDAYS(C6,H6)+MOD(H6-C6,1)-1=INT(K6)& " days "& HOUR(K6) &" hrs "& MINUTE(K6) &" mins"
7Tue 17/12/201910:14Tue 17/12/19 10:14Sun 22/12/201914:32Sun 22/12/19 14:32#VALUE!#VALUE!
8Mon 09/12/201910:14Mon 09/12/19 10:14Mon 09/12/201915:14Mon 09/12/19 15:14#VALUE!#VALUE!
9Mon 09/12/201918:14Mon 09/12/19 18:14Tue 10/12/201915:14Tue 10/12/19 15:14#VALUE!#VALUE!
Sheet1
Cell Formulas
RangeFormula
K2:K4K2=NETWORKDAYS(E2,J2)+MOD(J2-E2,1)-1
L2:L4,L7:L9L2=INT(K2)& " days "& HOUR(K2) &" hrs "& MINUTE(K2) &" mins"
N4N4=MAX(K2:K4)
O4O4=MIN(K2:K4)
K7:K9K7=NETWORKDAYS(C7,H7)+MOD(H7-C7,1)-1
C7:C9,H7:H9C7=CONCATENATE(TEXT(A7,"ddd dd/mm/yy")&" "&TEXT(B7,"hh:mm"))
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Why not just add the 2cells together & then use cell formatting to change how it's displayed.
Excel Formula:
=A7+B7
 
Upvote 0
Thank you Fluff, I've worked that out now.

I do have another issue though, when using the network days function.

I have the end date one day more than the start date, but the end time is less than the start time, the result still shows over 1 day.

So the start date is Tue 14/06/22 10:00 and the end date is Wed 15/06/22 08:30 the result shows 01 days 22hrs 30 mins, whereas it should show 00 days 22hrs 30mins

Can I get some advise with this please
 
Upvote 0
Con1.xlsm
ABC
114/06/2022 10:0015/06/2022 08:3022:30:00
Sheet2
Cell Formulas
RangeFormula
C1C1=NETWORKDAYS(A1,B1)-1+MOD(B1,1)-MOD(A1,1)
 
Upvote 0
Solution

Forum statistics

Threads
1,224,743
Messages
6,180,687
Members
452,994
Latest member
Janick

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