I have two rows with monthly rain run off per watershed as in the picture below.

I'd like to obtain the average runoff between may and august for basin 218187 and 218265 (note that basin 218187 will be 0 but the attribute table contains more rows). To do that I've created a new field but I'm struggling to write the code in the field calculator.

enter image description here

1 Answer 1


You have to select "Update existing field" > AverageRO and then type the following into the expression field:

("runoff_may" + "runoff_jun" + "runoff_jul" + "runoff_aug")/4

This will give you the arithmetic mean of the runoff values.

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.