I am creating inventory management systems in excel where there is quantity, status (open or closed, where open is where the items is still in customers hand, and closed where they already return the item), date check-in, and date check out.

I am wondering if anyone can come up with the formula for the number of items available, where the status determine the total item available?