Converting into different time format

allananthony

New Member
Joined
Jul 29, 2014
Messages
3
I was given an existing workbook containing the daily schedules of all employees. The cells under each employees names have the format (ex.) 8am-5pm. What is the formula to convert this into the format 8:00am-5:00pm on a different cell? I am trying to create a workbook where the actual sign in time will be input and from there show if the employee was on time or late. (I am not allowed to make any changes on the existing work book.)
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Welcome to MrExcel.

How do you propose to use a cell that contains 8:00am-5:00pm to check for lateness?


I found this formula that separates these values into separate cells;
=TRIM(LEFT(SUBSTITUTE(H60,"-",REPT(" ",99)),99))
=TRIM(RIGHT(SUBSTITUTE(H60,"-",REPT(" ",99)),99))

The formula I am using to 'subtract' actual sign in time from the scheduled start time is not working I think because of the difference in formatting (8am vs 8:00am).
 
Upvote 0
Try:

=TEXT(REPLACE(LEFT(H60,FIND("-",H60)-1),LEN(LEFT(H60,FIND("-",H60)-1))-1,0," "),"h AM/PM")
=TEXT(REPLACE(RIGHT(H60,LEN(H60)-FIND("-",H60)),LEN(RIGHT(H60,LEN(H60)-FIND("-",H60)))-1,0," "),"h AM/PM")

formatted as time.
 
Upvote 0

Forum statistics

Threads
1,215,053
Messages
6,122,888
Members
449,097
Latest member
dbomb1414

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