Calculate working time


"Excel VBA Help"

 


Play Friv Now - Play Friv Games
Go Back   The Code Cage Forums > Microsoft Topics > Microsoft Excel Forum
Our Info Pages:-
The Code Cage - Microsoft Office help

Notices

Microsoft Excel Forum Members Post questions in this forum if they are related to using Microsoft Excel, this includes Worksheet Functions, Excel VBA Programming, Simple Macro Code & Charting, Excel formula etc.

New Reply
Thread Tools Rate Thread Display Modes
  #1  
Unread 14th February 2017, 09:47
ksel's Avatar
ksel ksel is offline
Junior Member
MS Office Version: Excel 2010
MS Office Skill Level: Can use Formulae
 
Join Date: Sep 2009
Location: Antwerp, Belgium
Age: 45
Posts: 34
Posts Per Day: 0.01
My Top Tip Count: 0
Thanks to others: 15
Thanked 0 Times in 0 Posts
Reputation: 10 (8) ksel is on a distinguished road
Belgium
Default Calculate working time
     Excel: Functions   


------ Register to get rid of these "In Post" ads! ------

Category: Excel: Functions   

Hi,
In attachment the file with working hours per day. Different codes are used per type of working time, e.g. T for training, Z for illness, FU for holidays etc. These codes are in the column to the left of the time that was spent on this activity. There can be multiple activities per day, this will be spread over multiple lines.
Each code belongs to 1 of 3 categories: Worked time (G), non-worked time (NG) and overtime (O). In the sheet 'Categories' I made a short example.

What I need is the total per week for each category, per employee. An additional problem is that there can be multiple lines per employee: in this example there are 1 or 2 lines, but it can be up to 6. The name and ID (number) is only mentioned on the first line. How can I get the totals per category per week per employee?

Thanks a lot,
Kristoff
Attached Files To view attachments in this forum your post count must be 2 or greater. You currently have 0 posts.

The Code Cage Advertisment
Advertisement
  #2  
Unread 14th February 2017, 13:21
Pete_UK's Avatar
Pete_UK Pete_UK is offline
Solution Centre Professional
MS Office Version: MS Office 2003, 2007
MS Office Skill Level: Proficient with Excel
 
Join Date: Mar 2009
Location: Warrington, England
Age: 65
Posts: 640
Posts Per Day: 0.21
My Top Tip Count: 0
Thanks to others: 8
Thanked 135 Times in 134 Posts
Reputation: 2624 (41) Pete_UK has a reputation beyond reputePete_UK has a reputation beyond reputePete_UK has a reputation beyond reputePete_UK has a reputation beyond reputePete_UK has a reputation beyond reputePete_UK has a reputation beyond reputePete_UK has a reputation beyond reputePete_UK has a reputation beyond reputePete_UK has a reputation beyond reputePete_UK has a reputation beyond reputePete_UK has a reputation beyond repute
Great_Britain
Default Re: Calculate working time

------ Register to get rid of these "In Post" ads! ------


You can put this formula in W9:

My Formula:
=IF(D9="TOTAL:",SUMPRODUCT((INDEX(F:F,MATCH(LOOKUP("zzz",C$1:C9),C:C,0)):R9="G")+(INDEX(F:F,MATCH(LOOKUP("zzz",C$1:C9),C:C,0)):R9="FU"),INDEX(G:G,MATCH(LOOKUP("zzz",C$1:C9),C:C,0)):S9),"")

A similar formula can be used in X9, i.e.:

My Formula:
=IF(D9="TOTAL:",SUMPRODUCT((INDEX(F:F,MATCH(LOOKUP("zzz",C$1:C9),C:C,0)):R9="Z")+(INDEX(F:F,MATCH(LOOKUP("zzz",C$1:C9),C:C,0)):R9="R"),INDEX(G:G,MATCH(LOOKUP("zzz",C$1:C9),C:C,0)):S9),"")


Notice that the only change is the codes used (shown in red). You can use this formula in Y9:

My Formula:
=IF(D9="TOTAL:",SUMPRODUCT((INDEX(F:F,MATCH(LOOKUP("zzz",C$1:C9),C:C,0)):R9="O")+(INDEX(F:F,MATCH(LOOKUP("zzz",C$1:C9),C:C,0)):R9="OC"),INDEX(G:G,MATCH(LOOKUP("zzz",C$1:C9),C:C,0)):S9),"")


You should apply a custom format of [h]:mm to these cells, then you can copy the formula down as far as you need to. The attached file demonstrates this.

Hope this helps.

Pete
Attached Files To view attachments in this forum your post count must be 2 or greater. You currently have 0 posts.

  #3  
Unread 15th February 2017, 09:56
ksel's Avatar
ksel ksel is offline
Junior Member
MS Office Version: Excel 2010
MS Office Skill Level: Can use Formulae
 
Join Date: Sep 2009
Location: Antwerp, Belgium
Age: 45
Posts: 34
Posts Per Day: 0.01
My Top Tip Count: 0
Thanks to others: 15
Thanked 0 Times in 0 Posts
Reputation: 10 (8) ksel is on a distinguished road
Belgium
Default Re: Calculate working time

------ Register to get rid of these "In Post" ads! ------


Thanks for the suggestion, this is not the solution. I changed the attachment so it's more clear:

Each employee has different codes for the tasks they execute per day. They can work for 2 hours (code G), have 3 hours training (code T) and go home sick the remaining 3 hours (code Z). We use over 100 codes, so it's impossible to add each code into the formula. All codes they fall into 3 categories: working time (G), non-working time (NG) and overtime (O). I need the totals per employee per week per category.

In the example attached I gave some codes with their categories. The totals that I'm looking for are marked in orange.

For each employee there can be 1 to 6 lines of codes and times, but their name is mentioned only on the first line.

Thanks a lot,
Kristoff
Attached Files To view attachments in this forum your post count must be 2 or greater. You currently have 0 posts.

The Code Cage Advertisment
Advertisement
  #4  
Unread 28th March 2017, 10:37
ratcat's Avatar
ratcat ratcat is offline
Junior Member
MS Office Version: Excel 2007
MS Office Skill Level: No VBA Skills
 
Join Date: Mar 2010
Location: Australia
Posts: 23
Posts Per Day: 0.01
My Top Tip Count: 0
Thanks to others: 6
Thanked 1 Time in 1 Post
Reputation: 20 (8) ratcat is on a distinguished road
Australia
Default Re: Calculate working time

------ Register to get rid of these "In Post" ads! ------


G'day,

Has this been solved ?

  #5  
Unread 19th April 2017, 08:08
dzsokko's Avatar
dzsokko dzsokko is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some Formulae experience
 
Join Date: Apr 2017
Location: Tirgu Mures, Romania
Age: 39
Posts: 2
Posts Per Day: 0.05
My Top Tip Count: 0
Thanks to others: 0
Thanked 0 Times in 0 Posts
Reputation: 10 (1) dzsokko is on a distinguished road
Romania
Default Re: Calculate working time

------ Register to get rid of these "In Post" ads! ------


Very interesting post.

Interesting solution given above.

The Code Cage Advertisment
Advertisement
New Reply
The Code Cage at Facebookhe Code Cage at Twitter


Tags
calculate, time, working

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

The Code Cage Affilliates



http://www.thecodecage.com/forumz tested by McAfee Security http://www.thecodecage.com/forumz tested by McAfee Security

All times are GMT +1. The time now is 10:12.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Template-Modifications by TMS
No part of this board, functionality or creatives may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
Copyright ©2008 - , Simon lloyd.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application they represent and are used with permission from Microsoft
UA-8135493-1
Cultural Forum | Study at Malaysian University