Please add column H with reductions $3 and $1 and try in P9 and copy down:Formula:
=IF(O9="","",LET(m,MATCH(O9,$A$9:$A$17),INDEX($G$9:$G$17,m)*O9-INDEX($H$9:$H$17,m)))
And delete helper columns Q, R and S
Question: Your formula didn't do any calculations with Quantity yet? Isn't that important?
Bookmarks