View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default formula for a pension

"barbarat" wrote:
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(G190000,90000*.03+G1*.087)A ND(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))