If you know the function f except for the values of unknown parameters, you
can use Solver to find the values of those parameters that will minimize the
sum of squared errors (least squares). If the function is linear in those
unknown parameters, you can use LINEST to calculate them along with some
regression diagnostics.
Jerry