vba - Average in excel with different ranges -


sorry if has been asked before, not find answer here or elsewhere.

i average sums different lengths. example dataset in image, sales numbers different shops per week. how compute average say, week 5-7 without doing manually? periods sales in different shops change both in length , position in matrix. possible vba/macro?

image here!

for shop#1 macro give me 2 different averages; 1 sales in week 2-3, , 1 week 5-7.

the dataset i'm working on 400x50, varying lengths. in advance!

edit: ok, missed point averages should done groups , not whole period. answer below not relevant.

you sumif non blank cells , divide countif of non blank cells:

=sumif(b2:h2;"<>"&"")/countif(b2:h2;"<>"&"") 

Comments