Networkdays between 2 dates in different format

qike74

New Member
Joined
Jan 15, 2016
Messages
4
I'm trying to get the difference in hours between two dates which are displayed in a different format (one is in mm/dd/yyyy and the other is in dd/mm/yyyy). Changing the format cell doesn't help.
I'm trying different solutions without being able to succeed. Basically I would like to format the first one to display dd/mm/yyyy to make it work.

here is a sample:

Date Opened Date Closed Formula applied Result
8/1/2015 2:04 PM 14-01-2016 3:35 PM =SUM(((NETWORKDAYS(A2,B2)-1)*24),HOUR(B2-A2)) 6361 (Excel thinks the first is Jan and not August)
1/13/2016 12:04 PM 14-01-2016 3:35 PM =SUM(((NETWORKDAYS(A3,B3)-1)*24),HOUR(B3-A3)) #VALUE! (doesn't recognize 13 as a month I believe)

Any ideas? Thanks!!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

qike74

New Member
Joined
Jan 15, 2016
Messages
4
It looks like the formatting in the message is quite difficult to read. please find below an easier version to read:

Date Opened
A1) 8/1/2015 2:04 PM
A2) 1/13/2016 12:04 PM

Date Closed
B1) 14-01-2016 3:35 PM
B2) 14-01-2016 3:35 PM

Formula to be applied:
=SUM(((NETWORKDAYS(A,B)-1)*24),HOUR(B-A))

Results:
Line 1: 6361 (Excel thinks the date opened is Jan and not August.)
Line 2: #VALUE! (Excel doesn't recognize 13 as a month I believe)
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,419
Office Version
  1. 365
Platform
  1. Windows
So you have some American dates that you have pasted into an English excel sheet? Can you not convert the dates before they are imported?
 

qike74

New Member
Joined
Jan 15, 2016
Messages
4
I guess I could use the text to column feature but I'm looking for an automated solution so anytime the file is refreshed there is no manual intervention.

In order to simplify things I changed the second date to NOW() as this is the refresh time and will be the same.
However, even formatting the NOW() date to the original American I'm getting the same error.

Here I have uploaded a sample for better visibility:
http.//www.viajablog.com/wp-content/uploads/2016/01/sample.xlsx

It would be so great if anybody could have a look and understand what could be done

Thanks!
Enric
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,419
Office Version
  1. 365
Platform
  1. Windows
You could convert your dates that are text as such. Bear in mind that A2 seems to be incorrect. It closes before it opens!

=DATEVALUE(SUBSTITUTE(REPLACE(A2,1,FIND("/",A2),""),"/","/"&LEFT(A2,FIND("/",A2))))+MOD(MID(A2,FIND(" ",A2)+1,99),1)
 

Watch MrExcel Video

Forum statistics

Threads
1,132,685
Messages
5,654,746
Members
418,149
Latest member
amamiche67

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