Convert time duration into a value I can multiply

mduntley

Board Regular
Joined
May 23, 2015
Messages
134
Office Version
  1. 365
Platform
  1. Windows
I am pasting in a chart from my time clock system, but for the duration, if its more then 24 hours, excel will convert it to a date. I am looking a way to calculate my paycheck from the table I inserted.

White text is what pasted from my time clock, but I want something like what is in yellow so I can multiply my wage (in this example $8/hr)

Book1
ABCD
1Pay CodeAmountCalculate$8.00 per HR
22ND SHIFT DIFF4:00432
3PTO SCHEDULED48:00:0048384
4REGULAR4:304.536
5REGULAR24:00:0024192
6REGULAR32:00:0032256
7WEEKEND 2ND SHIFT DIFF12:001296
8WEEKEND DIFF12:4512.75102
Sheet2


This is my starting table for Power Query

Book1
AB
1Pay CodeAmount
22ND SHIFT DIFF4:00
3PTO SCHEDULED48:00:00
4REGULAR4:30
5REGULAR24:00:00
6REGULAR32:00:00
7WEEKEND 2ND SHIFT DIFF12:00
8WEEKEND DIFF12:45
Sheet2
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
D2 would be
Excel Formula:
=B2*24*$D$1
and pull down ( just enter 8 in D1 to make it simpler) - Format as number - Col C is not necessary
 
Upvote 0
Can be done like this

Book1
CD
2Pay CodeAmount
32ND SHIFT DIFF4:00
4PTO SCHEDULED48:00:00
5REGULAR4:30
6REGULAR24:00:00
7REGULAR32:00:00
8WEEKEND 2ND SHIFT DIFF12:00
9WEEKEND DIFF12:45
Sheet2


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table6"]}[Content],
    Set_types = Table.TransformColumnTypes(Source,{{"Pay Code", type text}, {"Amount", type duration}}),
    Calc_HR = Table.AddColumn(Set_types, "8$ per HR", each Duration.TotalSeconds([Amount])/3600*8)
in
    Calc_HR

Book1
GHI
2Pay CodeAmount8$ per HR
32ND SHIFT DIFF0.04:00:0032
4PTO SCHEDULED2.00:00:00384
5REGULAR0.04:30:0036
6REGULAR1.00:00:00192
7REGULAR1.08:00:00256
8WEEKEND 2ND SHIFT DIFF0.12:00:0096
9WEEKEND DIFF0.12:45:00102
Sheet2
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,578
Members
449,174
Latest member
chandan4057

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