This is for an online game and I am trying to build a database of what I have in the game. I have modified my data to protect my privacy a bit and bit in some better example data.
I essentially have a training courses log sheet, and a building database sheet with different fire stations. Each station has a set of staff working at them. Each one also requires a certain number of staff to operate the vehicles at that station. I also then can have people in training courses.
In the image below I have combined the two sheets onto one sheet just to make it easier to illustrate. To note, the end date would be used to exclude any completed courses from being used in the "In-Training" count.
And here is an annotated mock-up of what the results of the example above should automatically be turned into.