Macro to convert data in cells into time and caculate number of hours (Nice challenge this one!)

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi everyone,,
I've got one to get your brains thinking,
Ok so I've got a sheet and it has times in it (Its a record of peoples working week and the hours they have done)

the way the data is collected is simply as data, it has little or no reflection on a time, I need to work out the number of hours worked.
so here is what I need,

Columns B,C,D,E,F,G,H currently have the hours worked have the hours worked l need to take the data, translate it into a time frame and calculate the hours for each of those cells, I have no problem with columns being added to make the data calculate out
Currently a column looks like this:
9:00a - 4:00p
5:00p - 8:00p
7:00a - 4:00p
5:30a - 2:00p
3:00p - wed 12:00a

<COLGROUP><COL style="WIDTH: 86pt; mso-width-source: userset; mso-width-alt: 3680" width=115><TBODY>
</TBODY>
as you can see it has all sorts of problems including "wed" in the way.
any ideas how I can get this to work?
the result I want is one cell start time, the next cell end time the next cell how many hour's worked

thanks

Tony
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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