Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
neominds
 
Posts: n/a
Default DATEIF and IF statements


Greetings,

I am working an a timecard situation in which I need to account for
accrued vacation days. But, I am running into some problems nesting the
IF statements. The employee is to accrue vacation time as follows:

1 week for 1 year worked
2 weeks for 2 years worked
3 weeks for 5-10 years worked
4 weeks for 10 years worked.

I can figure out how to nest them for the 1 yr., 2 yr., and 10 yr. but
am having troubles figuring out the 5-10 yr. range. This is my formula
for the first 2 years.

=IF((AND((DATEDIF(F4,NOW(),"y")=1),F6="Accrual")), AE4*0.0192,(IF((AND((DATEDIF(F4,NOW(),"y")=2),F6=" Accrual")),AE4*0.0384,0)))

F4 = the hire date

Anyone out there that can assist me? It's much appreciated...

Thanks,

Michael


--
neominds
------------------------------------------------------------------------
neominds's Profile: http://www.excelforum.com/member.php...o&userid=25204
View this thread: http://www.excelforum.com/showthread...hreadid=394778

  #2   Report Post  
Harlan Grove
 
Posts: n/a
Default

neominds wrote...
....
1 week for 1 year worked
2 weeks for 2 years worked
3 weeks for 5-10 years worked
4 weeks for 10 years worked.

I can figure out how to nest them for the 1 yr., 2 yr., and 10 yr. but
am having troubles figuring out the 5-10 yr. range. This is my formula
for the first 2 years.

=IF((AND((DATEDIF(F4,NOW(),"y")=1),F6="Accrual")) ,AE4*0.0192,
(IF((AND((DATEDIF(F4,NOW(),"y")=2),F6="Accrual")) ,AE4*0.0384,0)))

F4 = the hire date

....

Ditch the unnecessary extra parentheses. Use a lookup.

=IF(F6="Accrual",AE4,0)*0.0192
*LOOKUP(DATEDIF(F4,NOW(),"Y"),{0;1;2;5;11},{0;1;2; 3;4})

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
CALCULATING DATES AFTER DATEIF Glen Excel Discussion (Misc queries) 1 June 5th 05 07:24 PM


All times are GMT +1. The time now is 05:55 PM.

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"