I am trying to find/write a function in JavaScript that will perform the same thing as GoalSeek in excel.

Thanks