Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default Calculate total days

Hi
I have a table of employee record of sick date, vacation date as PTO
(personal time off) and all record start end date as below.

My question is how to write a code so that I will have a summary table with
% of PTO in a year for each employees?

PTO code 100 = start to take off(no work)
PTO code 200= back to work

employee name PTO code date
A 100 2/23/07
B 100 5/07/07
C 100 8/26/07
A 200 4/23/07
B 200 6/04/07
C 200 9/19/07

From this table I can manually calculate employee A take PTO
from 2/23 to 4/23 so the percentage can be calculate as
60/365*100= 16.4% days off during 2007



Thanks in advance
Daniel

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Calculate total days

Daniel,

If you have your sample table in A1:C7, enter A into cell E2, B into E3, C
in E4, then in cell F2, array enter (Enter using Ctrl-Shift-Enter) the
formula

=(MAX(IF($A$2:$A$7=E2,IF($B$2:$B$7=200,$C$2:$C$7," "),""))-MAX(IF($A$2:$A$7=E2,IF($B$2:$B$7=100,$C$2:$C$7,"") ,"")))/365

This assumes that the names in column A are unique, appear twice, once each
with 100 and 200, and the dates are true dates. Format the cell F2 for
percentage, and copy down to match your list in E.

HTH,
Bernie
MS Excel MVP


"Daniel" wrote in message
...
Hi
I have a table of employee record of sick date, vacation date as PTO
(personal time off) and all record start end date as below.

My question is how to write a code so that I will have a summary table
with
% of PTO in a year for each employees?

PTO code 100 = start to take off(no work)
PTO code 200= back to work

employee name PTO code date
A 100 2/23/07
B 100 5/07/07
C 100 8/26/07
A 200 4/23/07
B 200 6/04/07
C 200 9/19/07

From this table I can manually calculate employee A take PTO
from 2/23 to 4/23 so the percentage can be calculate as
60/365*100= 16.4% days off during 2007



Thanks in advance
Daniel



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Total days worked /20 to get actual months/days Cindy Excel Worksheet Functions 3 October 22nd 09 11:50 PM
Automatically calculate the previous days total 'sales' PVANS Excel Discussion (Misc queries) 6 July 17th 09 11:09 AM
Total last 30 days Eric Excel Worksheet Functions 6 April 6th 07 03:02 AM
calculate count on 2006 total, 2005 total, etc... Amanda Deshotel Excel Worksheet Functions 6 September 28th 06 11:59 PM
How to calculate # days between business days Susan Hayes Excel Programming 2 September 8th 05 03:39 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"