It seems like I got the same problem which is discussed in this thread. But since it's 2 years old already, there's an easy solution to this by now?
I'm joining a vector layer which contains seperat buildings with values to a grid with the algorithm "join attributes by location (summary)". My "summaries to calculate" option is "sum". Now my problem is, sometimes the buildings cross the line of a rectangle of the grid (see image). In these cases, the building gets recognized twice and thus the resulting sum of the layer is higher than it should be. My question is, how can I tell QGIS to put the buildings each only in one grid if they're set in two? The best solution would be, if the buildings would automatically be set in the square where the most of it is in.