Hour difference calculation in Power Query

sanket_sk

Board Regular
Joined
Dec 27, 2016
Messages
140
Office Version
  1. 365
Platform
  1. Windows
Hi There,

Merry Christmas !!!

Friends I am looking for function / formula to calculate hourly difference in two dates using Power Query.
I tried using hours / total hours and also by combining Hours and minutes but end result was always different than excel calculation ( Competed - Start)
Please help


Closed Calls 19-12.xlsx
ABC
1WOCOMPLETEDDATEWOSTARTDATEHour Diference
216-12-20 11:0114-12-20 11:0048:01
316-12-20 11:0514-12-20 10:4448:21
416-12-20 13:1815-12-20 11:4525:33
516-12-20 13:2314-12-20 9:2651:56
616-12-20 10:3515-12-20 8:4725:48
717-12-20 10:4915-12-20 9:5248:56
817-12-20 10:4215-12-20 11:1947:22
917-12-20 12:0416-12-20 8:2727:37
1018-12-20 11:2916-12-20 9:3149:57
Sheet1
Cell Formulas
RangeFormula
C2:C10C2=A2-B2
 
Last edited by a moderator:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
you forgot to mention the special time format [h]: mm that you used in column C

WOCOMPLETEDDATEWOSTARTDATESubtraction
16/12/2020 11:0114/12/2020 11:002.00:01:00
16/12/2020 11:0514/12/2020 10:442.00:21:07
16/12/2020 13:1815/12/2020 11:451.01:33:41
16/12/2020 13:2314/12/2020 09:262.03:56:24
16/12/2020 10:3515/12/2020 08:471.01:48:19
17/12/2020 10:4915/12/2020 09:522.00:56:40
17/12/2020 10:4215/12/2020 11:191.23:22:31
17/12/2020 12:0416/12/2020 08:271.03:37:08
18/12/2020 11:2916/12/2020 09:312.01:57:32

here the last column format is d.hh:mm:ss where d means days
 
Upvote 0
Hi There,

Merry Christmas !!!

Friends I am looking for function / formula to calculate hourly difference in two dates using Power Query.
I tried using hours / total hours and also by combining Hours and minutes but end result was always different than excel calculation ( Competed - Start)
Please help


Closed Calls 19-12.xlsx
ABC
1WOCOMPLETEDDATEWOSTARTDATEHour Diference
216-12-20 11:0114-12-20 11:0048:01
316-12-20 11:0514-12-20 10:4448:21
416-12-20 13:1815-12-20 11:4525:33
516-12-20 13:2314-12-20 9:2651:56
616-12-20 10:3515-12-20 8:4725:48
717-12-20 10:4915-12-20 9:5248:56
817-12-20 10:4215-12-20 11:1947:22
917-12-20 12:0416-12-20 8:2727:37
1018-12-20 11:2916-12-20 9:3149:57
Sheet1
Cell Formulas
RangeFormula
C2:C10C2=A2-B2
Hi, there! When you apply subtraction between 2 Datetime data in Power Query, the result is of type Duration; Power Query applies a standard "d.hh:mm:ss" format to the result.
 
Upvote 0

Forum statistics

Threads
1,223,753
Messages
6,174,307
Members
452,554
Latest member
Louis1225

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