Calculating Time

Afaes

New Member
Joined
Dec 11, 2021
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi All, can you please help me with the following question:

I can’t figure out how to calculate the time in Column A to get 8hrs in Column B. Is there a formula I can use in Column B that will give me 8hrs? Thanks!


Column A Column B
7am - 3pm ??
 
Hello- below is an example. How would I write the formula to get the total hours worked for the week for Employee 1 and Employee 2?

Hours worked should say 40 for each employee.

Thank you

SundayMondayTuesdayWednesdayThursdayFridaySaturdayHours Worked
Employee 17a-3p7a-3p7a-3p7a-3p7a-3p
?​
Employee 2130p-930p130p-930p130p-930p130p-930p130p-930p
?​
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Thanks for the sample data.
With 7 cells and value that are not even actual times I don't see a feasible solution with standard worksheet formulas.
Perhaps somebody else might see a way.

Would a vba solution be acceptable?
 
Upvote 0
Thanks for the sample data.
With 7 cells and value that are not even actual times I don't see a feasible solution with standard worksheet formulas.
Perhaps somebody else might see a way.

Would a vba solution be acceptable?
I am not familiar with vba. I was afraid that would be the case about addiding multiple cells to get the total hours. Would it matter any if I used 0700-1500 instead?
 
Upvote 0
Would it matter any if I used 0700-1500 instead?
That would make it much easier

Afaes.xlsm
ABCDEFGHI
1SundayMondayTuesdayWednesdayThursdayFridaySaturdayHours Worked
2Employee 10700-15000700-15000700-15000700-15000700-150040
3Employee 21330-21301330-21301330-21301330-21301330-213040
Hours (3)
Cell Formulas
RangeFormula
I2:I3I2=24*SUMPRODUCT(IFERROR(REPLACE(RIGHT(B2:H2,4),3,0,":")-REPLACE(LEFT(B2:H2,4),3,0,":"),0))


.. or easier still if you could use time format

Afaes.xlsm
ABCDEFGHI
1SundayMondayTuesdayWednesdayThursdayFridaySaturdayHours Worked
2Employee 107:00-15:0007:00-15:0007:00-15:0007:00-15:0007:00-15:0040
3Employee 213:30-21:3013:30-21:3013:30-21:3013:30-21:3013:30-21:3040
Hours (4)
Cell Formulas
RangeFormula
I2:I3I2=24*SUMPRODUCT(IFERROR(RIGHT(B2:H2,5)-LEFT(B2:H2,5),0))
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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