Compare required units with units already available. Replenish the shortfall only; a surplus stays in stock rather than turning into a negative replenishment instruction.
Work in the spreadsheet, keeping the source columns intact. Read each row before filling the output column: the extract includes a boundary case that can expose an attractive but incorrect formula. Start with the guided example, then repeat the calculation on a changed extract and an operational handoff. The workbook uses original fictional records. A result must still work when quantities and charges change, so use cell references rather than a typed total.
Compare required units with units already available. Replenish the shortfall only; a surplus stays in stock rather than turning into a negative replenishment instruction.