If your input is in A1 and the thing you want to modify is in B1, then this works (in OpenOffice.org, anyway):

Code:
=IF(EXACT(RIGHT(A1;2);"ar");CONCATENATE(B1;"aste");IF(OR(EXACT(RIGHT(A1;2);"er");EXACT(RIGHT(A1;2);"ir"));CONCATENATE(B1;"iste");B1))


You have to put it in a separate cell. There's no way to modify the existing cell, AFAIK.
_________________________
Bitt Faulk