开发者

need to write a function to add values based on query in EXCEL

S.no Area 1 55 2 65 开发者_StackOverflow3 51 4 70 5 55 6 65 7 75 8 60 9 45 10 50 11 70 12 52 13 65 14 40 15 60 16 55 17 50 18 65 19 85 20 81

By entering range of Sno. e.g 3 to 5 I MUST GET THE ADDITION OF Area for specified range of Sno.

Note : range of sno. may vary like 3 to 5 , 10 to 18 etc.


=SUMIF(A1:A100,"<=5",B1:B100)-SUMIF(A1:A100,"<3",B1:B100)

Sum everything less than five, then subtract the sum of everything less than three. Adjust the range references to fit your data. Or if you like array formulas

=SUMPRODUCT((A1:A100<=5)*(A1:A100>=3)*(B1:B100))

does the same thing.


Have a look at the help for SUMIF.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜