formula for a pension

B

barbarat

Help, please...I am using Excel 2003...as a newbie...
I need to calculate (in Column I) the match for a 401(k) as follows:
Column G is compensation, H is employee contribution, and B is Date of birth
(as numbers...ie, 01011986).
The match is $1 for each dollar invested up to 3% of compensation, and $.75
for each dollar invested over 3%, but not greater than 6%, of compensation,
and $.50 match for each dollar between 7 and 10%. No match over 10%. Also
no match if employee is under 18 yrs of age at 12/31/04.
I have tried IF...and keep gettong the wrong results.
Any help will be greatly appreciated. Thank you.
 
J

joeu2004

barbarat said:
I need to calculate (in Column I) the match for a 401(k) as follows:
Column G is compensation, H is employee contribution, and B is Date
of birth (as numbers...ie, 01011986).
The match is $1 for each dollar invested up to 3% of compensation,
and $.75 for each dollar invested over 3%, but not greater than 6%,
of compensation, and $.50 match for each dollar between 7 and 10%.
No match over 10%. Also no match if employee is under 18 yrs of
age at 12/31/04.
I have tried IF...and keep gettong the wrong results.

I assume you mean "not greater than 7%" or "between
6 and 10%". Otherwise, answer: what is the match for
the amount between 6% and 7% of compensation?

Ostensibly:

IF(DATEDIF(B1, "12/31/2004", "y") < 18, 0,
INT(MIN(H1, G1*3%))
+ 0.75*MAX(0, INT(MIN(H1-G1*3%, G1*6%)))
+ 0.50*MAX(0, INT(MIN(H1-G1*6%, G1*10%))))

This assumes that no birthday is after 12/31/2004. It also
assumes that B1 is the form of mm/dd/yyyy. Yours is in
the form mmddyyyy. Ideally, change the format in B1.
Otherwise, replace B1 above with the following formula
or a reference to a helper cell with it:

DATEVALUE(INT(B1/1000000)
& "/" & INT(MOD(B1,1000000)/10000)
& "/" & MOD(B1,10000))
 
J

joeu2004

Errata ....
IF(DATEDIF(B1, "12/31/2004", "y") < 18, 0,
INT(MIN(H1, G1*3%))
+ 0.75*MAX(0, INT(MIN(H1-G1*3%, G1*6%)))
+ 0.50*MAX(0, INT(MIN(H1-G1*6%, G1*10%))))

Should be:

IF(DATEDIF(B1, "12/31/2004", "y") < 18, 0,
INT(MIN(H1, G1*3%))
+ 0.75*MAX(0, INT(MIN(H1, G1*6%) - G1*3%))
+ 0.50*MAX(0, INT(MIN(H1, G1*10%) - G1*6%)))
 
B

barbarat

I will try this tonight...thanks so much! I'll let you know whether it is
successful.
 
B

barbarat

IT WORKED!! Thank you so much. This board is wonderful; I will use it often
as a resource as I learn Excel. Perhaps I will learn enough so that someday
it will be I who can answer a question! thank you again.
 
B

barbarat

Hello again...yes, I think I understand it. The INT is for rounding, right?
And the MIN/MAX I get, now! I was trying to find a way to meet the
constraints, and this did it perfectly. I knew an IF would do it in one
column if designed correctly. I am thinking of a new column, for profit
sharing...but need to formulate in my head so I am clear. I will try posting
what I think the formula needs to be, at the risk of sounding confused, when
I have a better handle on it. I learned much from looking at the difference
in my formula (which was pathetic), and yours! Thanks again.
 
J

joeu2004

barbarat said:
Hello again...yes, I think I understand it.
Great.

The INT is for rounding, right?

Well, for truncating. It will match $1 to $1 through $1.99.
If you want to round (match $2 to $1.50 through $2.49),
change INT(...) to ROUND(...,0). If you want to match $2
to $1.01 through $2 -- i.e, to any dollar or part thereof --
use ROUNDUP(...,0) or CEILING(...,1).
 
B

barbarat

got it...that is going to come in really handy for spreadsheets in the
future. I had an IF statement a mile long, and it would not work!
so, what if i wanted to do a similar calc; a profit sharing based on 3% of
compensation up to 90,000 plus 8.7% of all compensation? no contribution is
allocated above $200000, but there are really no employees at that level,
anyway.
On 12/31/04 they must be 21 yrs old, have worked 1000 hrs for that year and
still be employed with the company .
would something like this work: hrs worked is column J, and terminated Y/N
is K:

=IF(DATEDIF(B1,"12/31/2004","y")<21,0,ANDIF(J1=>1000),0,IF(G1=<90000,(G1*.03+G1*.087)OR(IF(G1>90000,90000*.03+G1*.087)AND(IFG1=>2000000,(90000*.03+200000*.087),0)))

please...no laughing. i would love to find out where in this formula i've
gone wrong. thanks!
 
P

Peo Sjoblom

It is not truncating, check with a negative value

--
Regards,

Peo Sjoblom

(No private emails please)
 
B

barbarat

what does that mean, please? are you referring to the first formula, and the
INT, or something about the second formula that I need to correct...well, i
know it needs correcting; it doesn't work. help please thanks!
 
P

Peo Sjoblom

I meant with regards, to the post saying "Well, for truncating"
it is incorrect, INT rounds down to the nearest integer, TRUNC truncates

5.5
-5.5

INT returns

5
-6

while TRUNC

returns

5
-5


my post was not in response to your post

having said that without checking your formula if you want to use AND you
use it as

=IF(AND(DATEDIF(B1,"12/31/2004","y")<21,J1>=1000),0,etc

meaning that if younger than 21 and if J1 is greater or equal to 1000, then
return 0, else do this or that

--
Regards,

Peo Sjoblom

(No private emails please)
 
B

barbarat

(e-mail address removed):
can you explain CEILING to me, please? I am trying to do the second
formula, and since the limit on compensation is 200000, thought ths would
work...it doesn't.:

IF(AND(DATEDIF(B1,"12/31,2004","y")<21,J1>=1000),0,IF(OR(K1=Y,IF(AND(G1<=90000),0,INT(MIN(G1*.03+G!.087))OR(IF(G1>=90000),CEILING(g1=200000)MAX(G1*.03*+G1*.087),0))))
 
B

barbarat

okay...so i tried changig the format in the Date of termination, instead of
Terminated, Y or N, I put 0 if not, and a date (numerical) if yes. still
can't make it work. I think I have too many ifs...it keeps saying "to many
arguments", but thought we could use 7?? help, please?
conditions again:
employee must not be terminated on 12/31/04 (now column D), be 21 (DOB
column B), worked 1000 hrs (column E), be employed for one year (date of hire
is column C) and then up to 90000 is a profit share match of 3%, plus 8.7% of
total compensation. no share over 200000 of compensation.
I changed my formerly posted formula (which did not work) to numerical for
date of termination, and used Ceiling to try to force the 200000 limit. I
have tried adding commas, removing commas, adding/removing
parentheses...help, please! thanks.
 
J

joeu2004

Peo Sjoblom said:
I meant with regards, to the post saying "Well, for truncating"
it is incorrect, INT rounds down to the nearest integer,
TRUNC truncates

Technically correct. My comment was made in context.
The discussion is about compensation etc, which is always
positive. The OP said that INT() would "round". I said it
"truncates". Arguably, I should have said "rounds down".
I was tempted to write that, but I thought "truncate" might
be clearer, since it is the same thing for positive numbers.

Having said all that, I will try to be more careful in the future,
since "int" does mean truncate (the unsigned magnitude)
in some programming languages.
 
B

barbarat

i understood that the INT worked to rund because it was positive. i should
have stated that i went to the manual, and under help, so i got what you
said.
can you help me with the second part?
also, i had a thought. on the first formula, could i have used a separate
sheet, then filtered out the no's, then done a formula that referenced the
prior sheet? or is that more complicated (it's all complicated to me!)
the second one, i keep getting error messages, and when i try to get out of
the ell, lose what i have entered...help, please
 
J

joeu2004

barbarat said:
can you explain CEILING to me, please?

Forget about Excel's CEILING() function. It is poorly
defined, in my opinion. Besides, I really did mean
ROUNDDOWN(...,0), even for negative numbers,
although that should not be an issue for you.
I am trying to do the second formula, and since the
limit on compensation is 200000, thought ths would
work...it doesn't.:

IF([...] CEILING(g1=200000)MAX(G1*.03*+G1*.087),0))))

I am not exactly sure what you are trying to write. The
above is syntactically incorrect. Even if you meant:

CEILING(g1=200000,1)*MAX(...)

that is non-sensical. CEILING(x,1), in this case, returns the
largest integer value of x rounded up, away from zero. The
expression "g1 = 200000" is a boolean (true, false), not a
number that we would normally apply CEILING() to.
 
J

joeu2004

barbarat said:
so, what if i wanted to do a similar calc; a profit sharing
based on 3% of compensation up to 90,000 plus 8.7% of
all compensation? no contribution is allocated above $200000

If I understand correctly, that could be written:

ROUND(3%*MIN(G1,90000) + 8.7%*MIN(G1,200000), 2)

That rounds to cents. Replace ",2" with ",0" to round to dollars.
On 12/31/04 they must be 21 yrs old, have worked 1000 hrs
for that year and still be employed with the company .
would something like this work: hrs worked is column J,
and terminated Y/N is K:

=IF(DATEDIF(B1,"12/31/2004","y")<21,0,ANDIF(J1=>1000),0,[...]

I assume you mean "at least 21 yr old" and "at least 1000 hr".
That could be written:

IF(OR(DATEDIF(B1,"12/31/2004","y")<21, J1<1000, K1="Y"), 0,
ROUND(3%*MIN(G1,90000) + 8.7%*MIN(G1,200000), 2))

or equivalently:

IF(AND(DATEDIF(B1,"12/31/2004","y")>=21, J1>=1000, K1="N"),
ROUND(3%*MIN(G1,90000) + 8.7%*MIN(G1,200000), 2), 0)
=IF(DATEDIF(B1,"12/31/2004","y")<21,0,ANDIF(J1=>1000),0,IF(G1=<90000,
(G1*.03+G1*.087)OR(IF(G1>90000,90000*.03+G1*.087)AND(IFG1=>2000000,
(90000*.03+200000*.087),0)))

please...no laughing. i would love to find out where in this formula
i've gone wrong.

Lots of syntax errors, too many to comment individually.
But there is no harm in wanting to use IF() functions, if
that makes the logic clearer to you. I might write:

IF(OR(DATEDIF(B1,"12/31/2004","y")<21, J1<1000, K1="Y"), 0,
ROUND(IF(G1 <= 90000, 11.7%*G1,
IF(G1 <= 200000, 3%*90000 + 8.7%*G1,
3%*90000 + 8.7%*200000)), 2))
 
B

barbarat

that worked perfectly! and is much shorter than my sad attempt! after
comparing my formula to yours, i see that i am unsure of commas, and )'s.
and the rules for what comes first...is there a rule i could learn, and if so
where do i look for it? meaning, what should i reference in the manual
index? the date thing really confuses me. if i wanted to use numerical,
like 01011984 instead of mm/dd/yyyy, what would i need to change? thanks so
much for your help.
--
barbarat


barbarat said:
so, what if i wanted to do a similar calc; a profit sharing
based on 3% of compensation up to 90,000 plus 8.7% of
all compensation? no contribution is allocated above $200000

If I understand correctly, that could be written:

ROUND(3%*MIN(G1,90000) + 8.7%*MIN(G1,200000), 2)

That rounds to cents. Replace ",2" with ",0" to round to dollars.
On 12/31/04 they must be 21 yrs old, have worked 1000 hrs
for that year and still be employed with the company .
would something like this work: hrs worked is column J,
and terminated Y/N is K:

=IF(DATEDIF(B1,"12/31/2004","y")<21,0,ANDIF(J1=>1000),0,[...]

I assume you mean "at least 21 yr old" and "at least 1000 hr".
That could be written:

IF(OR(DATEDIF(B1,"12/31/2004","y")<21, J1<1000, K1="Y"), 0,
ROUND(3%*MIN(G1,90000) + 8.7%*MIN(G1,200000), 2))

or equivalently:

IF(AND(DATEDIF(B1,"12/31/2004","y")>=21, J1>=1000, K1="N"),
ROUND(3%*MIN(G1,90000) + 8.7%*MIN(G1,200000), 2), 0)
=IF(DATEDIF(B1,"12/31/2004","y")<21,0,ANDIF(J1=>1000),0,IF(G1=<90000,
(G1*.03+G1*.087)OR(IF(G1>90000,90000*.03+G1*.087)AND(IFG1=>2000000,
(90000*.03+200000*.087),0)))

please...no laughing. i would love to find out where in this formula
i've gone wrong.

Lots of syntax errors, too many to comment individually.
But there is no harm in wanting to use IF() functions, if
that makes the logic clearer to you. I might write:

IF(OR(DATEDIF(B1,"12/31/2004","y")<21, J1<1000, K1="Y"), 0,
ROUND(IF(G1 <= 90000, 11.7%*G1,
IF(G1 <= 200000, 3%*90000 + 8.7%*G1,
3%*90000 + 8.7%*200000)), 2))
 
B

barbarat

I am trying to understand the differences in how i wrote the IFs; you gave me
this, which did just what i wanted:
=IF(OR(DATEDIF(B2,"12/31/04","y")<21,E2<1000,D2>0),0,ROUND(IF(G2<=90000,11.7%*G2,IF(G2<=200000,3%*90000+8.7%*G2,3%*90000+8.7%*200000)),2))
now, trying to add a limit to it that all contributions (employee, match and
profit share, cap at 40000, and the reduction is in the profit share. since
this formula is in the column (H) for the profit share, can it be amended to
do the reduction? Or do I make a new column, add this result to match
(column I), and limit that to 40000?
sorry, this is all very new to me. thanks so much for your assistance,
Barbara
--
barbarat


barbarat said:
that worked perfectly! and is much shorter than my sad attempt! after
comparing my formula to yours, i see that i am unsure of commas, and )'s.
and the rules for what comes first...is there a rule i could learn, and if so
where do i look for it? meaning, what should i reference in the manual
index? the date thing really confuses me. if i wanted to use numerical,
like 01011984 instead of mm/dd/yyyy, what would i need to change? thanks so
much for your help.
--
barbarat


barbarat said:
so, what if i wanted to do a similar calc; a profit sharing
based on 3% of compensation up to 90,000 plus 8.7% of
all compensation? no contribution is allocated above $200000

If I understand correctly, that could be written:

ROUND(3%*MIN(G1,90000) + 8.7%*MIN(G1,200000), 2)

That rounds to cents. Replace ",2" with ",0" to round to dollars.
On 12/31/04 they must be 21 yrs old, have worked 1000 hrs
for that year and still be employed with the company .
would something like this work: hrs worked is column J,
and terminated Y/N is K:

=IF(DATEDIF(B1,"12/31/2004","y")<21,0,ANDIF(J1=>1000),0,[...]

I assume you mean "at least 21 yr old" and "at least 1000 hr".
That could be written:

IF(OR(DATEDIF(B1,"12/31/2004","y")<21, J1<1000, K1="Y"), 0,
ROUND(3%*MIN(G1,90000) + 8.7%*MIN(G1,200000), 2))

or equivalently:

IF(AND(DATEDIF(B1,"12/31/2004","y")>=21, J1>=1000, K1="N"),
ROUND(3%*MIN(G1,90000) + 8.7%*MIN(G1,200000), 2), 0)
=IF(DATEDIF(B1,"12/31/2004","y")<21,0,ANDIF(J1=>1000),0,IF(G1=<90000,
(G1*.03+G1*.087)OR(IF(G1>90000,90000*.03+G1*.087)AND(IFG1=>2000000,
(90000*.03+200000*.087),0)))

please...no laughing. i would love to find out where in this formula
i've gone wrong.

Lots of syntax errors, too many to comment individually.
But there is no harm in wanting to use IF() functions, if
that makes the logic clearer to you. I might write:

IF(OR(DATEDIF(B1,"12/31/2004","y")<21, J1<1000, K1="Y"), 0,
ROUND(IF(G1 <= 90000, 11.7%*G1,
IF(G1 <= 200000, 3%*90000 + 8.7%*G1,
3%*90000 + 8.7%*200000)), 2))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top