$sp$ = sell price
$cp$ = cost price
$p$ = profit
$m$ = margin
So to get $p,$ we do:
$$sp - {sp\over6} - 0.08sp - 0.024sp - cp$$
or, with figures:
$$12.99 - {12.99 \over6} - 12.99 \times0.08 - 12.99 \times0.024 - 8.63$$
This gives $0.84$ profit.
To get margin, we do:
$0.84 / (12.99 / 1.2)$
This gives: $7.8\%$ margin
What would the formula be if we wanted to get the sell price / price to sell at, with a margin of $5\%$?
Apologies for the formatting, I'm new here.
You say profit
$$p = s_p - \frac{s_p}{6} - 0.08s_p - 0.024s_p - c_p$$
and margin is
$$m = \frac{p}{s_p / 1.2} $$
We can simplify these two expressions to give
$$ p = \frac{547}{750}s_p - c_p \quad \text{ and } \quad m = \frac{6p}{5s_p} $$
We then substitute:
$$ m = \frac{\frac{547}{125}s_p - 6c_p}{5s_p} = \frac{547}{625} - \frac{6c_p}{5s_p} $$
Rearranging:
$$ s_p = \frac{6c_p}{\frac{547}{125} - 5m} = \frac{750c_p}{547 - 625m} $$
If margin is $5\%$ and $c_p = 8.63$ then $s_p = 12.55$.