Thanks a lot red
That will be very helpful next time I (or anyone else) need to calculate the strange shape of certain blocks for some weird object.
Actually, I found the solution to my specific problem after a night's sleep, but much more complex than what you just explained. Your information should allow me to generalize next time 
In my case, I wanted to calculate the shape of the tiles placed on this roof, in particular those above the apse:

I've also attached my spreadsheet for anyone who might be interested. It's not quite finished, but works pretty well already. It comes without a manual, so you need to have a basic understanding of geometry to use it. Just complete the green boxes and don't touch anything else.