简体   繁体   English

Excel公式:如果列B的值在X和Y之间,则添加列A的值

[英]Excel formula: Add Column A value if Column B value is between X and Y

I've been looking all over for an answer to this, but I've had a hard time finding one. 我一直在寻找答案,但是我一直很难找到答案。

My data looks like this, but much longer: 我的数据看起来像这样,但时间更长:

Sessions (A)   Screen Width (B)
875            1020
869            1580
864            1520
809            1420

I'm looking for a formula that will come up with a sum of all values in column A, but only if the value in column B is between 768 and 1024 (as one example). 我正在寻找一个公式,该公式将得出A列中所有值的总和,但前提是B列中的值在768到1024之间(例如)。

I am but a lowly designer, and do not understand things like numbers and formulas. 我只是一个不起眼的设计师,并且不了解数字和公式之类的内容。 :) :)

Seriously though, I tried SUMIF and SUMIFS and a few other things, but couldn't figure out if I was on the right path or not. 虽然很认真,但是我尝试了SUMIF和SUMIFS以及其他一些东西,但是无法弄清楚我是否走对了。

I really appreciate the help. 我非常感谢您的帮助。 Thanks! 谢谢!

Thanks to Scott Craner: 感谢Scott Craner:

=SUMIFS(A:A,B:B,">=768",B:B,"<=1024")

I had a secondary problem, which was that my Column A values were stored as text rather than numbers, which why everything I tried kept coming up 0. To fix that, I had to include Value() in my formula. 我有第二个问题,那就是我的列A值存储为文本而不是数字,这就是为什么我尝试的所有内容都一直保持为0的原因。要解决此问题,我必须在公式中包含Value()。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM