Reputation: 3
What is a simple way to expand the following formula so it applies to rows 2-20 of my spreadsheet:
=SUM(IF(B2=1,M2),IF(B3=1,M3),IF(B4=1,M4))
Upvotes: 0
Views: 66
Reputation: 22886
= SUMPRODUCT( ( B2:B20 = 1 ) * M2:M20 )
or
= SUMIF(B2:B20, 1, M2:M20)
Upvotes: 1
Reputation: 328
This formula will add up the rows in column M, if the same row column B = 1.
SUMIF(B2:B20,1,M2:M20)
Upvotes: 0