Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi. I need to calculate the numer of hours (with a 30mim range) between diferent shifts.
For example... I go to work at 6am and leave at 23h. As my payments are different depending of my shift i need to know how many hours i worked between 7 to 22 and how many i worked from 22 to 7. Can you help me please? I have been thinking of a way of do this but im not getting it... Diogo |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Diogo,
Am Tue, 28 Jan 2014 18:27:35 -0800 (PST) schrieb : For example... I go to work at 6am and leave at 23h. As my payments are different depending of my shift i need to know how many hours i worked between 7 to 22 and how many i worked from 22 to 7. start time in A2, end time in B2 Then for hours between 7:00 and 22:00 in C2: =IF(B2A2,MIN(B2,TIME(22,,))-MAX(A2,TIME(7,,)),MAX(TIME(22,,)-A2,0)+MAX(B2-TIME(7,,),0)) and for hours between 22:00 and 7:00 in D2: =MOD(B2-A2,1)-C2 Regards Claus B. -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi again,
Am Wed, 29 Jan 2014 09:43:05 +0100 schrieb Claus Busch: Then for hours between 7:00 and 22:00 in C2: =IF(B2A2,MIN(B2,TIME(22,,))-MAX(A2,TIME(7,,)),MAX(TIME(22,,)-A2,0)+MAX(B2-TIME(7,,),0)) change the formula above to: =IF(B2A2,MAX(MIN(B2,TIME(22,,))-MAX(A2,TIME(7,,)),0),MAX(TIME(22,,)-A2,0)+MAX(B2-TIME(7,,),0)) Regards Claus B. -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks.
I will try to understand it ;) And i will check if it works well... Greetings Diogo |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Wednesday, January 29, 2014 8:54:57 AM UTC, Claus Busch wrote:
Hi again, Am Wed, 29 Jan 2014 09:43:05 +0100 schrieb Claus Busch: Then for hours between 7:00 and 22:00 in C2: =IF(B2A2,MIN(B2,TIME(22,,))-MAX(A2,TIME(7,,)),MAX(TIME(22,,)-A2,0)+MAX(B2-TIME(7,,),0)) change the formula above to: =IF(B2A2,MAX(MIN(B2,TIME(22,,))-MAX(A2,TIME(7,,)),0),MAX(TIME(22,,)-A2,0)+MAX(B2-TIME(7,,),0)) Regards Claus B. -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 Claus, When i try it,i get an error... http://postimg.org/image/4li0iqk95/ I don't understand what the problem... I even tried to change A2 and B2 to date and to time, but it didnt work either... |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Well, i guess i solved it... changed all , to ;
However, now the results are worng... For example, with IN = 3:00 and OUT = 14:00 the results on C2 are 0.291667 and i would expect it to be 7 (14-7) |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
Am Wed, 29 Jan 2014 05:38:52 -0800 (PST) schrieb : Claus, When i try it,i get an error... http://postimg.org/image/4li0iqk95/ I made the formulas for real times so as 2:00 or 14:00 Please have a look he https://skydrive.live.com/#cid=9378A...121822A3%21326 for the workbook "Time" Regards Claus B. -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
Am Wed, 29 Jan 2014 05:44:31 -0800 (PST) schrieb : For example, with IN = 3:00 and OUT = 14:00 the results on C2 are 0.291667 and i would expect it to be 7 (14-7) the result is correct. You have to format the cell hh:mm or h:mm Regards Claus B. -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
#9
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() Thanks! Did it. Works Really Thanks |
#10
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Claus, can you please explain the thinking behind the formula? Maybe to divide the formula in small pieces and explain?im asking because i would like to understand it and because i will need to do another formula for holidays with different shifts prices (7h-13h-22h) and i would like to try myself.
Thanks Diogo |
#11
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() |
#12
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks so much
I will read it real closely so i can fully understand. And ineill be posting here my formula for the weekends (7-13-22). Do you think its going to be similar or will i need to work it from scratch? |
#13
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Done it!
Now, and at last, making a new formula for the days I'm on shifts "on call" instead of "on physical presence". Let's see how it goes... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ROUND UP HOURS to the next quarter hour | Excel Discussion (Misc queries) | |||
How do I add hours and minutes without 24 hour limit | Excel Worksheet Functions | |||
How to count hours- and multiply with my wage per hour... | Excel Discussion (Misc queries) | |||
How can I add hours and minutes then multiply by cost per hour? | Excel Worksheet Functions | |||
total work hours for 24 hour on-call schedules | Excel Discussion (Misc queries) |