If then... else

Hi there. I am trying to get the solution for 3 tables with conditions.
I have a table order and production and products.
in order table you have ready products but in production the same product needed to be produced from the components. In the “product” table you have total inventory (which is “+” for storage), there is total requested (“qty from orders”). I would like to get such functionality that if "Production. Status=“OK” then add to the total inventory else do nothing.
Right now I need to place an order then place the production. And immediately total inventory changes according to the production plan, which is not really true since the status is “pending”.
I am using the spreadsheet formula to get counting like =IFERROR(VLOOKUP(A2;‘Delivery Details’!$C$2:$H$500;2;0);0)+SUMIF(RECEPTY!B:B;C2;RECEPTY!C:C)).