Thanks for your file.
Seems to me some key elements are missing ...
In your sample file you had :
1. Tasks with Start and End Dates in Sheet Data
2. Projects with Start and End Dates in Sheet Output
It is only with the Projects Start and End Dates which serve as References that you are in a position to compare them to the Tasks Start and End Dates ....and, afterwards only ... calculate the periods with the highest concentration of Tasks ...
Thanks for your clarification