在SUMIF功能中执行功能

发布于 2025-02-05 17:49:03 字数 745 浏览 2 评论 0原文

我正在用sumif函数在范围内使用:我希望以下格式:

   A       B
1  1.1     5
2  1.2     5
3  1.3     5
4  2.1     5
5  2.2     5

我希望sumif通过其整数组合在一起,即:

   A    B
1  1    15
2  2    10

我可以通过创建一个第三列c并应用int(a),以便:(

   A       B    C
1  1.1     5    1
2  1.2     5    1
3  1.3     5    1
4  2.1     5    2
5  2.2     5    2

对于1)

=SUMIF(C:C, 1, B:B)

有没有办法在一个单元格中执行此操作?即

=SUMIF(A1:A5, "int(range) = 1", B1:B5)

我也尝试过:

=SUMIF(A1:A5, "1*", B1:B5)

但是

=SUMIF(A1:A5, 1&"*", B1:B5)

这些也不起作用

I am writing a SUMIF function on a range with a format such as:

   A       B
1  1.1     5
2  1.2     5
3  1.3     5
4  2.1     5
5  2.2     5

I want the SUMIF to group values together by their integer, i.e.:

   A    B
1  1    15
2  2    10

I can do this by creating a third column C and applying INT(A) so that:

   A       B    C
1  1.1     5    1
2  1.2     5    1
3  1.3     5    1
4  2.1     5    2
5  2.2     5    2

and (for 1)

=SUMIF(C:C, 1, B:B)

Is there a way to do this in one cell? i.e.

=SUMIF(A1:A5, "int(range) = 1", B1:B5)

I have also tried:

=SUMIF(A1:A5, "1*", B1:B5)

and

=SUMIF(A1:A5, 1&"*", B1:B5)

But these also do not work

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

季末如歌 2025-02-12 17:49:03

您可以使用sumproduct eg

=SUMPRODUCT(--(INT($A$1:$A$5)=C1),$B$1:$B$5)

int($ a $ 1:$ a $ 5)= c1生成true s and code> false false 的数组/代码> s。 -操作员将其转换为0 s和1 s的数组。然后,您将乘以B中的值

。 a7zow.png“ alt =”在此处输入图像描述”>

You can use SUMPRODUCT e.g.

=SUMPRODUCT(--(INT($A$1:$A$5)=C1),$B$1:$B$5)

INT($A$1:$A$5)=C1 produces an array of TRUEs and FALSEs. The -- operator converts that to an array of 0s and 1s. Then you multiply by the values in B.

enter image description here

瑾夏年华 2025-02-12 17:49:03

单元格F12中的公式为:

=SUMIFS($B$1:$B$5;$A$1:$A$5;">="&E12;$A$1:$A$5;"<"&E12+1)

拖动

enter image description here

Formula in cell F12 is:

=SUMIFS($B$1:$B$5;$A$1:$A$5;">="&E12;$A$1:$A$5;"<"&E12+1)

Drag down

流心雨 2025-02-12 17:49:03

使用 excel 365 您可以做到这一点,例如 -

 =LET(x,UNIQUE(INT(A1:A5)),y,SUMIFS(B1:B5,A1:A5,">="&x,A1:A5,"<"&x+1),CHOOSE({1,2},x,y))

< img src =“ https://i.sstatic.net/ai0zi.png” alt =“在此处输入图像说明”>

With Excel 365 you can do it like-

 =LET(x,UNIQUE(INT(A1:A5)),y,SUMIFS(B1:B5,A1:A5,">="&x,A1:A5,"<"&x+1),CHOOSE({1,2},x,y))

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文