Formula to format Time Punch

nhawkins

New Member
Joined
Jan 22, 2018
Messages
3
Hi,

I am trying to re-format a time punch into a new date column using a formula.

Currently there is a date column in the following format:
[TABLE="width: 61"]
<tbody>[TR]
[TD]01/01/17[/TD]
[/TR]
</tbody>[/TABLE]

There is another column in the sheet with the clock in times which does not have the date in the proper format (example of dates shown below):
[TABLE="width: 47"]
<colgroup><col></colgroup><tbody>[TR]
[TD]158[/TD]
[/TR]
[TR]
[TD]0917[/TD]
[/TR]
[TR]
[TD]2042
[/TD]
[/TR]
</tbody>[/TABLE]

I would like to create a new column which combines both into the excel date formatting so I can input it into a different template.

Thanks so much for your help!
 

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.
Hi - welcome to the board.

Could you indicate what dates those values are meant to represent?
 
Upvote 0
Hi - welcome to the board.

Could you indicate what dates those values are meant to represent?


Thank you!
These are the times people clock in
158 = 1:58 AM
0917= 09:17 AM
2042 = 8:42 PM

The dates are housed in another column and id like to combine them into one column but am having difficulty with there being no : to separate hours and minutes :?

Thanks again!
 
Upvote 0
Hi,

You can do one of these,

Formula in D1 will convert your A1 and B1 data to show the way you want, BUT it's result is TEXT.
Formula in F1 will convert your A1 and B1 data and give you a NUMBERIC result so you can do further calculations with in, but you'll have to custom FORMAT the cell to: mm/dd/yy hh:mm AM/PM


Book1
ABCDEFGHIJ
101/01/1715801/01/17 01:58 AM01/01/17 01:58 AMFALSETRUE
201/02/17091701/02/17 09:17 AM01/02/17 09:17 AM
301/03/17204201/03/17 08:42 PM01/03/17 08:42 PM
Sheet19
Cell Formulas
RangeFormula
H1=ISNUMBER(D1)
J1=ISNUMBER(F1)
D1=TEXT(A1,"mm/dd/yy")&" "&TEXT(LEFT(B1,LEN(B1)-2)&":"&RIGHT(B1,2),"hh:mm AM/PM")
F1=A1+TEXT(LEFT(B1,LEN(B1)-2)&":"&RIGHT(B1,2),"hh:mm AM/PM")
 
Upvote 0
Hi,

You can do one of these,

Formula in D1 will convert your A1 and B1 data to show the way you want, BUT it's result is TEXT.
Formula in F1 will convert your A1 and B1 data and give you a NUMBERIC result so you can do further calculations with in, but you'll have to custom FORMAT the cell to: mm/dd/yy hh:mm AM/PM

ABCDEFGHIJ
01/01/17 01:58 AM
01/02/17 09:17 AM
01/03/17 08:42 PM

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]01/01/17[/TD]
[TD="align: right"]158[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"]01/01/17 01:58 AM[/TD]
[TD="align: right"][/TD]
[TD="align: right"]FALSE[/TD]
[TD="align: right"][/TD]
[TD="align: right"]TRUE[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]01/02/17[/TD]
[TD="align: right"]0917[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"]01/02/17 09:17 AM[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]01/03/17[/TD]
[TD="align: right"]2042[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"]01/03/17 08:42 PM[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet19

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]H1[/TH]
[TD="align: left"]=ISNUMBER(D1)[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]J1[/TH]
[TD="align: left"]=ISNUMBER(F1)[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D1[/TH]
[TD="align: left"]=TEXT(A1,"mm/dd/yy")&" "&TEXT(LEFT(B1,LEN(B1)-2)&":"&RIGHT(B1,2),"hh:mm AM/PM")[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F1[/TH]
[TD="align: left"]=A1+TEXT(LEFT(B1,LEN(B1)-2)&":"&RIGHT(B1,2),"hh:mm AM/PM")[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

This worked great! Thank you so so much!!
 
Upvote 0
You're welcome, welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

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