Hatefiend
Hatefiend

Reputation: 3596

Summation Function in Google Sheets

I have data which can be used to find the amount of snowfall in a particular month.

MONTH    SNOWFALL INDEX
Jan        0.25
Feb        0.1
Mar        0.6
Apr        0.99
May        0.2
Jun        0.2
Jul        0.01
Aug        0.09
Sep        1.0
Oct        0.5
Nov        0.8
Dec        0.39

To calculate how much snow falls in each month, I have the following formula:

snowfall_amount = (130 - snowfall_index) / 90

I want to write a formula which adds up the amount of snowfall between the months of march and april. Normally, I would create a third column and make the formula:

=130 - $B2 / 90

and then drag that formula down. Then my solution would be:

=SUM($C5:$C6)

However here I am looking for a one-cell solution. Intuitively it seems like this is the job for a Summation but I don't see any way to do that through formulas.

Upvotes: 0

Views: 187

Answers (1)

Tom Sharpe
Tom Sharpe

Reputation: 34230

Try

=ArrayFormula(sum((130-index(B2:B,match(C2,A2:A,0)):index(B2:B,match(D2,A2:A,0)))/90))

enter image description here

Upvotes: 3

Related Questions