I have two shapafiles: points and vector grid. I need to combine points which are in the same cell(or cross cell) and sum their values. How can I do this in QGIS?

2 Answers 2


Since QGIS 3.18 using the array_sum() function, you can use the following expression on the grid layer to calculate the sum of the value attribute from all points that are within a grid-cell automatically:

array_sum (overlay_contains ('points', value))

Screenshot: the expression (together with to_int to get integer values) calculates the blue value for each grid cell: sum of the values of all red points within this cell:

enter image description here


You need to do a spatial join using the join attributes by location tool. You can choose to sum the attribute field from the points layer. So this should output a new grid layer with the sum of the points attribute

See this tutorial for how to perform it


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.