Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
kkh kkh is offline
external usenet poster
 
Posts: 4
Default Calculation using a date

I have worksheets where I have a formula to calculate the number of years and
months of service. I would like to use that date to calculate excess annual
leave hours. (Example: calculation shows at 23 years 4 months, I need to use
this to calculate the following: 0 to 4 years =360; 5 to 9 years=624; 10-19
years=640; 20+ years=680) Note: The calculation for years and months will be
different on each employee. Can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Calculation using a date

Hi,

You don't give us the formula for how you got 23 years 4 months but I assume
it's a mixture of formula and text concatenated so try this

=IF(LEFT(A1,FIND(" ",A1)-1)+0=20,680,IF(LEFT(A1,FIND("
",A1)-1)+0=10,640,IF(LEFT(A1,FIND(" ",A1)-1)+0=5,624,360)))

Mike

"KKH" wrote:

I have worksheets where I have a formula to calculate the number of years and
months of service. I would like to use that date to calculate excess annual
leave hours. (Example: calculation shows at 23 years 4 months, I need to use
this to calculate the following: 0 to 4 years =360; 5 to 9 years=624; 10-19
years=640; 20+ years=680) Note: The calculation for years and months will be
different on each employee. Can anyone help?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Calculation using a date

It looks like all you need to know is the years.

Create a 2 column table like this with the lower year boundary for each
interval in the left column:

......F.....G
1...0.....360
2...5.....624
3..10....640
4..20....680

Then, if:

A1 = 23 years 4 months

=IF(A1="","",LOOKUP(--LEFT(A1,FIND(" ",A1)-1),F1:G4))

--
Biff
Microsoft Excel MVP


"KKH" wrote in message
...
I have worksheets where I have a formula to calculate the number of years
and
months of service. I would like to use that date to calculate excess
annual
leave hours. (Example: calculation shows at 23 years 4 months, I need to
use
this to calculate the following: 0 to 4 years =360; 5 to 9 years=624;
10-19
years=640; 20+ years=680) Note: The calculation for years and months will
be
different on each employee. Can anyone help?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
kkh kkh is offline
external usenet poster
 
Posts: 4
Default Calculation using a date

Sorry, I used =DATEDIF(P1,TODAY(),"y")&" years "&DATEDIF(P1,TODAY(),"ym")&"
months". Will this make a difference on how the other function works?

"Mike H" wrote:

Hi,

You don't give us the formula for how you got 23 years 4 months but I assume
it's a mixture of formula and text concatenated so try this

=IF(LEFT(A1,FIND(" ",A1)-1)+0=20,680,IF(LEFT(A1,FIND("
",A1)-1)+0=10,640,IF(LEFT(A1,FIND(" ",A1)-1)+0=5,624,360)))

Mike

"KKH" wrote:

I have worksheets where I have a formula to calculate the number of years and
months of service. I would like to use that date to calculate excess annual
leave hours. (Example: calculation shows at 23 years 4 months, I need to use
this to calculate the following: 0 to 4 years =360; 5 to 9 years=624; 10-19
years=640; 20+ years=680) Note: The calculation for years and months will be
different on each employee. Can anyone help?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Calculation using a date

Nope

"KKH" wrote:

Sorry, I used =DATEDIF(P1,TODAY(),"y")&" years "&DATEDIF(P1,TODAY(),"ym")&"
months". Will this make a difference on how the other function works?

"Mike H" wrote:

Hi,

You don't give us the formula for how you got 23 years 4 months but I assume
it's a mixture of formula and text concatenated so try this

=IF(LEFT(A1,FIND(" ",A1)-1)+0=20,680,IF(LEFT(A1,FIND("
",A1)-1)+0=10,640,IF(LEFT(A1,FIND(" ",A1)-1)+0=5,624,360)))

Mike

"KKH" wrote:

I have worksheets where I have a formula to calculate the number of years and
months of service. I would like to use that date to calculate excess annual
leave hours. (Example: calculation shows at 23 years 4 months, I need to use
this to calculate the following: 0 to 4 years =360; 5 to 9 years=624; 10-19
years=640; 20+ years=680) Note: The calculation for years and months will be
different on each employee. Can anyone help?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
kkh kkh is offline
external usenet poster
 
Posts: 4
Default Calculation using a date

This worked beautifully. Thank you very much.

"Mike H" wrote:

Hi,

You don't give us the formula for how you got 23 years 4 months but I assume
it's a mixture of formula and text concatenated so try this

=IF(LEFT(A1,FIND(" ",A1)-1)+0=20,680,IF(LEFT(A1,FIND("
",A1)-1)+0=10,640,IF(LEFT(A1,FIND(" ",A1)-1)+0=5,624,360)))

Mike

"KKH" wrote:

I have worksheets where I have a formula to calculate the number of years and
months of service. I would like to use that date to calculate excess annual
leave hours. (Example: calculation shows at 23 years 4 months, I need to use
this to calculate the following: 0 to 4 years =360; 5 to 9 years=624; 10-19
years=640; 20+ years=680) Note: The calculation for years and months will be
different on each employee. Can anyone help?

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
A specific date used for calculation of a new date Ditte Excel Discussion (Misc queries) 7 July 17th 09 08:00 AM
Date Calculation (from entered date / 1yr later in next field) ajaminb Excel Worksheet Functions 6 September 29th 08 02:11 PM
End Date Calculation (adding a start date duration) Silena K-K Excel Discussion (Misc queries) 5 January 25th 08 04:27 PM
Date calculation Faith Excel Discussion (Misc queries) 3 September 10th 07 03:44 PM
Tricky Date calculation: How to calculate a future date [email protected] Excel Discussion (Misc queries) 9 August 11th 06 04:24 AM


All times are GMT +1. The time now is 10:10 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"