ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   need formula if x<a3<y, value, else (https://www.excelbanter.com/excel-worksheet-functions/74734-need-formula-if-x-a3-y-value-else.html)

GAprecious

need formula if x<a3<y, value, else
 
I am trying to set up an accrual formula for vacation days, what I am needing
is a formula that will accrue at different rates, for example, employee earns
10 days per year up to 2 years, after 2 years, earns additional 1 day per
year to a max of 15 days per year the formula I have is not working: I am
getting a "FALSE" result for the 2nd, 3rd and 4th variables - PLEASE HELP!
=IF(C5<2,0.833333333333333,IF(2<C5<3,0.91666666666 6667,
IF(3<C5<4,1.08333333333333,IF(4<C5<5,1.16666666666 667,IF(5<C5,1.25)))))

Sloth

need formula if x<a3<y, value, else
 
you can't do that. change you formula to this...

=IF(C5<2,0.833333333333333,IF(C5<3,0.9166666666666 67,IF(C5<4,1.08333333333333,IF(C5<5,1.166666666666 67,IF(5<C5,1.25)))))

this will work because if C is not less than 2, then you don't need to check
that again.

If you don't feel comfortable with that, you can use something like this...

=IF(AND(X<A3,A3<Y),"do true","do false")

"GAprecious" wrote:

I am trying to set up an accrual formula for vacation days, what I am needing
is a formula that will accrue at different rates, for example, employee earns
10 days per year up to 2 years, after 2 years, earns additional 1 day per
year to a max of 15 days per year the formula I have is not working: I am
getting a "FALSE" result for the 2nd, 3rd and 4th variables - PLEASE HELP!
=IF(C5<2,0.833333333333333,IF(2<C5<3,0.91666666666 6667,
IF(3<C5<4,1.08333333333333,IF(4<C5<5,1.16666666666 667,IF(5<C5,1.25)))))


GAprecious

need formula if x<a3<y, value, else
 
Thanks soooo much - you are a lifesaver :)

"Sloth" wrote:

you can't do that. change you formula to this...

=IF(C5<2,0.833333333333333,IF(C5<3,0.9166666666666 67,IF(C5<4,1.08333333333333,IF(C5<5,1.166666666666 67,IF(5<C5,1.25)))))

this will work because if C is not less than 2, then you don't need to check
that again.

If you don't feel comfortable with that, you can use something like this...

=IF(AND(X<A3,A3<Y),"do true","do false")

"GAprecious" wrote:

I am trying to set up an accrual formula for vacation days, what I am needing
is a formula that will accrue at different rates, for example, employee earns
10 days per year up to 2 years, after 2 years, earns additional 1 day per
year to a max of 15 days per year the formula I have is not working: I am
getting a "FALSE" result for the 2nd, 3rd and 4th variables - PLEASE HELP!
=IF(C5<2,0.833333333333333,IF(2<C5<3,0.91666666666 6667,
IF(3<C5<4,1.08333333333333,IF(4<C5<5,1.16666666666 667,IF(5<C5,1.25)))))


GAprecious

need formula if x<a3<y, value, else
 


"Sloth" wrote:

you can't do that. change you formula to this...

=IF(C5<2,0.833333333333333,IF(C5<3,0.9166666666666 67,IF(C5<4,1.08333333333333,IF(C5<5,1.166666666666 67,IF(5<C5,1.25)))))

this will work because if C is not less than 2, then you don't need to check
that again.

If you don't feel comfortable with that, you can use something like this...

=IF(AND(X<A3,A3<Y),"do true","do false")

"GAprecious" wrote:

I am trying to set up an accrual formula for vacation days, what I am needing
is a formula that will accrue at different rates, for example, employee earns
10 days per year up to 2 years, after 2 years, earns additional 1 day per
year to a max of 15 days per year the formula I have is not working: I am
getting a "FALSE" result for the 2nd, 3rd and 4th variables - PLEASE HELP!
=IF(C5<2,0.833333333333333,IF(2<C5<3,0.91666666666 6667,
IF(3<C5<4,1.08333333333333,IF(4<C5<5,1.16666666666 667,IF(5<C5,1.25)))))


Dana DeLouis

need formula if x<a3<y, value, else
 
An additional idea to Sloth's excellent formula might be to factor out the
1/12th part.

=IF(C5<2,10,IF(C5<3,11,IF(C5<4,13,IF(C5<5,14,15))) )/12

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"GAprecious" wrote in message
...
Thanks soooo much - you are a lifesaver :)

"Sloth" wrote:

you can't do that. change you formula to this...

=IF(C5<2,0.833333333333333,IF(C5<3,0.9166666666666 67,IF(C5<4,1.08333333333333,IF(C5<5,1.166666666666 67,IF(5<C5,1.25)))))

this will work because if C is not less than 2, then you don't need to
check
that again.

If you don't feel comfortable with that, you can use something like
this...

=IF(AND(X<A3,A3<Y),"do true","do false")

"GAprecious" wrote:

I am trying to set up an accrual formula for vacation days, what I am
needing
is a formula that will accrue at different rates, for example, employee
earns
10 days per year up to 2 years, after 2 years, earns additional 1 day
per
year to a max of 15 days per year the formula I have is not working: I
am
getting a "FALSE" result for the 2nd, 3rd and 4th variables - PLEASE
HELP!
=IF(C5<2,0.833333333333333,IF(2<C5<3,0.91666666666 6667,
IF(3<C5<4,1.08333333333333,IF(4<C5<5,1.16666666666 667,IF(5<C5,1.25)))))





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com