Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Vacation Spreadsheet- formula not working.

I need to track the accrued vacation time for each employee per their hire
date. I have a formula but it's not working. I need to track this per year,
not a total of all the years. Here is the criteria and formula-

*During 1st year vacation employee will accumulate at 3.34 a day for every
month of service. (ie hire date = March 3, 2005- start accumulating April 3,
2005)
*Starting on Jan 1 of the following date of hire = 80 hrs each year.
*Starting on Jan 1 of the 10th year of service = 120 hrs each year.

Formula for <=9 Years-

=IF(AND(YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)0,YE AR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)=9), 9,YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0))*80

=10 Years-

=IF(YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)9,YE AR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)-9,0)*120


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Vacation Spreadsheet- formula not working.

You're asking someone to debug a mega formula without specifying
what the problem is. Does the formula return an error? An
incorrect result? What is the expected result, with what data,
and what is the actual result? You need to provide lots of detail
about the nature of the problem, rather than simply saying "this
massive formula doesn't work".


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"naiveprogrammer"
wrote in message
...
I need to track the accrued vacation time for each employee per
their hire
date. I have a formula but it's not working. I need to track
this per year,
not a total of all the years. Here is the criteria and formula-

*During 1st year vacation employee will accumulate at 3.34 a
day for every
month of service. (ie hire date = March 3, 2005- start
accumulating April 3,
2005)
*Starting on Jan 1 of the following date of hire = 80 hrs each
year.
*Starting on Jan 1 of the 10th year of service = 120 hrs each
year.

Formula for <=9 Years-

=IF(AND(YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)0,YE AR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)=9), 9,YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0))*80

=10 Years-

=IF(YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)9,YE AR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)-9,0)*120




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Vacation Spreadsheet- formula not working.

Sorry. The massive formula returns an incorrect result. For <=9 Years
formula I should get a result of 80, rather I receive 720. For =10 Years I
should get 120, rather I get 600.

Hope this helps!

"Chip Pearson" wrote:

You're asking someone to debug a mega formula without specifying
what the problem is. Does the formula return an error? An
incorrect result? What is the expected result, with what data,
and what is the actual result? You need to provide lots of detail
about the nature of the problem, rather than simply saying "this
massive formula doesn't work".


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"naiveprogrammer"
wrote in message
...
I need to track the accrued vacation time for each employee per
their hire
date. I have a formula but it's not working. I need to track
this per year,
not a total of all the years. Here is the criteria and formula-

*During 1st year vacation employee will accumulate at 3.34 a
day for every
month of service. (ie hire date = March 3, 2005- start
accumulating April 3,
2005)
*Starting on Jan 1 of the following date of hire = 80 hrs each
year.
*Starting on Jan 1 of the 10th year of service = 120 hrs each
year.

Formula for <=9 Years-

=IF(AND(YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)0,YE AR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)=9), 9,YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0))*80

=10 Years-

=IF(YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)9,YE AR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)-9,0)*120





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Vacation Spreadsheet- formula not working.

Without any source data there is no way for us to effectively check why you
are getting the result you are. My suggestion would be to break the formula
up into a bunch of intermidiate values (Calculate < 9 and 10 and ... in
seperate columns and ensure that each cell is returning what it should. Then
use a formula based on if statements and the intermediate values to arrive at
the correct totals. Sometimes formulas get too big to effectively be debugged
when something goes wrong.
--
HTH...

Jim Thomlinson


"naiveprogrammer" wrote:

Sorry. The massive formula returns an incorrect result. For <=9 Years
formula I should get a result of 80, rather I receive 720. For =10 Years I
should get 120, rather I get 600.

Hope this helps!

"Chip Pearson" wrote:

You're asking someone to debug a mega formula without specifying
what the problem is. Does the formula return an error? An
incorrect result? What is the expected result, with what data,
and what is the actual result? You need to provide lots of detail
about the nature of the problem, rather than simply saying "this
massive formula doesn't work".


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"naiveprogrammer"
wrote in message
...
I need to track the accrued vacation time for each employee per
their hire
date. I have a formula but it's not working. I need to track
this per year,
not a total of all the years. Here is the criteria and formula-

*During 1st year vacation employee will accumulate at 3.34 a
day for every
month of service. (ie hire date = March 3, 2005- start
accumulating April 3,
2005)
*Starting on Jan 1 of the following date of hire = 80 hrs each
year.
*Starting on Jan 1 of the 10th year of service = 120 hrs each
year.

Formula for <=9 Years-

=IF(AND(YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)0,YE AR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)=9), 9,YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0))*80

=10 Years-
=IF(YEAR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)9,YE AR(TODAY())-YEAR(DATE(YEAR(A2)+1,1,1))-IF(OR(MONTH(TODAY())<MONTH(DATE(YEAR(A2)+1,1,1)),A ND(MONTH(TODAY())=MONTH(DATE(YEAR(A2)+1,1,1)),
DAY(TODAY())<DAY(DATE(YEAR(A2)+1,1,1)))),1,0)-9,0)*120





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
ASSOCIATE VACATION TIME SPREADSHEET - EXEL DEAN Excel Discussion (Misc queries) 1 March 24th 09 10:05 AM
Vacation accrual Spreadsheet TimBeau Excel Discussion (Misc queries) 6 May 28th 08 03:40 PM
Vacation Spreadsheet- naiveprogrammer Excel Discussion (Misc queries) 0 August 30th 05 04:11 PM
Suggestions requested for vacation planning Excel spreadsheet echo144000 Excel Discussion (Misc queries) 1 December 14th 04 02:42 PM
spreadsheet that assigns vacation based upon seniority/time off a. lengleson Excel Programming 1 November 22nd 04 07:29 PM


All times are GMT +1. The time now is 03:45 PM.

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

About Us

"It's about Microsoft Excel"