(After writing this, I realized that this is the PowerBI forum, not the Excel forum. The below is an Excel answer).
This is a general problem disguised as an industry specific question. You have a bunch of events. Each event has a start date and it may or may not have an end date. You need to know the balance at any given point in time. A simple way to approach this is to recognize that the ending balance for each period is the beginning balance + additions - returns. If the dates the books are checked out and returned are named "checkoutdates" and "returndates", respectively, then you could write something like this:
So, if you have the beginning balance, then you can compute the number of additions with a =COUNTIFS function.
=COUNTIFS(checkoutdates,">"&1/1/15,checkoutdates,"<="&1/31/15)
And the number of returns is also a =COUNTIFS function.
=COUNTIFS(returndates,">"&1/1/15,returndates,"<="&1/31/15)
And then you just need the beginning balance, which you can get by making the first date =min(checkoutdates)