I have been developing costing spreadsheets for my company, and I would like to know if there is a function in Excel which allows two cells to be a function of each other. For example, Cell A2 has a formula which produces the sales price. Another cell B2 displays the margin based on the sales price produced in A2. Is there a way of making it possible so that I simply type a desired margin into cell B2, and A2 produces the sales price which reflects that margin, or vice-versa? I don't know what to call it: "fungibility" or a "vice-versa" function.

So far I have been calculating two separate formulas for both sales price and margin, but they are not a function of each other in these formulas.

Appreciate any comments