Greetings
I have 2 columns of numbers. A and B. B is generated from a function which depends on A. Is there a function or a method with which excel
1.searchs through the numbers of B and locates a number or the maximum of B column numbers
2. returns as a result NOT the above value, but the value of A that produced the value of B found.

For example B=function(A) How can we locate in which value of A, B peaked? Or in which value of A, B exceeds a certain number?
Sorting is a workaround for peak but It is messy with more columns.
Thanks