Formula to determine appropriate sales price to meet specific profit margin

I hope this is the correct forum.

I have a large inventory. Each item has a different amount for my cost. Currently I use complex spreadsheets to determine pricing and profit margin per. I am trying to come up with a formula that can be applied across the board and nix the spreadsheets. Here are the variables.

Each product has a cost: product cost

When I sell the product I have a fee based on the total sales price: seller fee

I want a specific profit margin: Profit margin

The only constant in this equation is the product cost. For this exercise lets put the seller's fee at 15% of total sales price, and the desired profit margin at 20%.

What I would like to do is apply some sort of variable to all products that will determine the appropriate sales price to always return 20% profit margin. The problem is that as the cost of different items gets larger a variable applied doesn't return enough profit. Also, as the sales price rises the fee becomes a larger number. As I said the only constant is the product cost. I am guessing you have to work from that point.

As an example lets use these numbers:

product A: product cost $10

product b: product cost $30

product c: product cost $100

product d: product cost $225

I'm not incredibly smart, but if you can figure it out I think you are.