Date Subtraction Formula not returning correct answer

Status
Not open for further replies.

Conell8383

Board Regular
Joined
Jul 26, 2016
Messages
66
Hi all. I hope you can help. I have inherited an excel sheet with a formula that I don't fully understand.
Essentially I believe the formula is looking to determine the amount of time a task from creation date and time (Cell U2) took to complete from (Cell V2) both in hours and minutes.
This is taking into consideration that my teams working hours are 8:30 am until 17:00 pm Monday to Friday excluding weekends and Holidays noted as 25th December 2017
I have attached a picture for better understand
The issue is that formula in W2 is returning a 0
The formula that is returning a 0 In W2 is
Code:
[FONT=Consolas]=(NETWORKDAYS.INTL(U2,V2,11,'Working Hours & Holidays'!$C$2)-1)*("17:00"-"8:30")+IF(NETWORKDAYS.INTL(V2,V2,11,'Working Hours & Holidays'!$C$2),MEDIAN(MOD(U2,1),"8:30","17:00"),"17:00")-MEDIAN(NETWORKDAYS.INTL(V2,V2,11,'Working Hours & Holidays'!$C$2)*MOD(U2,1),"8:30","17:00")[/FONT][/FONT][/COLOR]

As always any and all help is greatly appreciated.

6kzdzRY.png
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try this formula to calculate time:

=INT((V2-U2)*24)+(V2-U2-INT((V2-U2)*24))

This formula will work only if the task have a total time less than 24hs.

Format the cells as "Hours" format.
 
Last edited:
Upvote 0
Hi Eduzs. Thank you for taking the time to respond. Yes =INT((V2-U2)*24)+(V2-U2-INT((V2-U2)*24)) will work but I am curious as to why my formula wont return the correct answer. Again any help you can afford is greatly appreciated.
 
Upvote 0
Can you format as number only to see the actual value of "00:00"?
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,516
Messages
6,125,285
Members
449,218
Latest member
Excel Master

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