Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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? |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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? |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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? |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
A specific date used for calculation of a new date | Excel Discussion (Misc queries) | |||
Date Calculation (from entered date / 1yr later in next field) | Excel Worksheet Functions | |||
End Date Calculation (adding a start date duration) | Excel Discussion (Misc queries) | |||
Date calculation | Excel Discussion (Misc queries) | |||
Tricky Date calculation: How to calculate a future date | Excel Discussion (Misc queries) |