Timesheet Conversion Help

digi_virus

New Member
Joined
Apr 4, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I recently started a new job, and one of my responsibilities is the weekly data entry for our timesheets from the punched time cards. They had a simple spreadsheet set up for the formulas for calculating the hours worked after the times we converted from standard(2:43pm) to military with a decimal for the minutes(14.72). The issue is that the conversion is done by hand, for the hours that isn't so much of an issue but the conversion for the minutes I was given a sheet to use. Is there a simple formula to enter the standard time of 2:43pm in that example on a different section of the spread sheet, and have the formula convert it into military with decimals in the correct chart position? Also, we run mulitple shifts so workers who start at say 4:54pm and punch out at 2:37pm would be notated as clocking in at 16.75 and out at 26.62 giving them a working time of 9.87 hours.


Thank you for any help.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
The whole idea seems a bit overly complicated to me. If you're looking for a vba solution, try DateDiff function. This is a very common issue for people wanting to get hours and minutes between 2 dates where the date includes the time component. I imagine your cards have that.
Also figure that the 2:37 is AM of the next day rather than PM as you posted, in which case I get 9.716

If I'm wrong about the start and end times spanning over dates then ignore all that.
 
Upvote 0
Again, if spanning days, consider
VBA Code:
FormatDateTime(DateDiff("s",#04/04/2022 4:54:00 PM#,#04/05/2022 2:37:00 AM#)/86400,4)

I get 09:43, which is 9 hours and 43 minutes according to those date/time values.
 
Upvote 0
@digi_virus If I understand correctly, you are manually converting punched card times to your decimal military times which you then enter into a spreadsheet.
Dealing with time that may or may not span midnight can be more awkward than you might think especially if you are not using Excel time inclusive of date .

Vba certainly could be of value if you are able / willing to go that route.
Alternatively, below is an illustration of what could be a formula approach.
Coumns J:K would be the extra columns ('on a different area of the spreadsheet')
Formatted as Text, this where you would enter your Card In and Out times, in the format 3:00am, 10:33am, 9:00pm etc

Formulas in B and C, hopefully, convert those text entries to your required decimal military times.
Those times are used to compute hours worked and pay or whatever.
I think the only issue would be if you had any In or Out time that was exactly midnight!?

Book2
ABCDEFGHIJKL
1ConvertedConvertedCardCard
2Employee NameInOutHrs£/HrPayInOut
3Employee 1 16.9026.629.7210.00$97.204:54pm2:37am
4Employee 216.9022.625.7212.00$68.644:54pm10:37pm
5Employee 32.728.625.9010.00$59.002:43am8:37am
6Employee 423.7529.005.2512.00$63.0011:45pm5:00am
7Employee 54.0027.0023.0012.00$276.004:00am3:00am
8Employee 63.5026.5023.0010.00$230.003:30am2:30am
9Employee 78.0017.009.0012.00$108.008:00am5:00pm
Sheet1
Cell Formulas
RangeFormula
B3:B9B3=IFERROR(LET(In,TIMEVALUE(LEFT(J3,LEN(J3)-2))+IF(RIGHT(J3,2)="pm",0.5,0),HOUR(In)+ROUND(MINUTE(In)/60,2)),0)
C3:C9C3=IFERROR(LET(Cout,TIMEVALUE(LEFT(K3,LEN(K3)-2))+IF(RIGHT(K3,2)="pm",0.5,0),HOUR(Cout)+ROUND(MINUTE(Cout)/60,2)+IF(Cout<TIMEVALUE(LEFT(J3,LEN(J3)-2))+IF(RIGHT(J3,2)="pm",0.5,0),24,0)),0)
D3:D9D3=C3-B3
F3:F9F3=D3*E3


Hope that helps.
 
Upvote 0
A few ideas that you can consider. If you do not require all the detail, look at the last row.
Format the time to your preference.

Time.xlsm
ABCDEFGH
1CardCardConvertedConverted
2Employee NameInOutInOutHrs£/HrPay
3Employee 1 4:54pm2:37am04:54 PM02:37 AM9.7210.0097.20
4Employee 24:54pm10:37pm16:5422:375.7211.0062.92
5Employee 32:43am8:37am02:4308:375.9012.0070.80
6Employee 411:45pm5:00am23:4505:005.2513.0068.25
7Employee 54:00am3:00am04:0003:0023.0014.00322.00
8Employee 63:30am2:30am03:3002:3023.0015.00345.00
9Employee 78:00am5:00pm08:0017:009.0016.00144.00
10
11Employee 1 4:54pm2:37am9.7210.0097.20
7a
Cell Formulas
RangeFormula
D3:E9D3=--SUBSTITUTE(SUBSTITUTE(B3,"a"," a"),"p"," p")
F3:F9F3=ROUND((E3-D3+(D3>E3))*24,2)
H3:H9,H11H3=F3*G3
F11F11=LET(i,--SUBSTITUTE(SUBSTITUTE(B11,"a"," a"),"p"," p"),o,--SUBSTITUTE(SUBSTITUTE(C11,"a"," a"),"p"," p"),ROUND((o-i+(i>o))*24,2))
 
Upvote 0
Thanks Snakehips. Hopefully, the OP tries your suggestion and also my suggestion.

The Op could determine if the Time system can export in a format that doesn't require the conversions.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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