根据数值添加可变数量的值

发布于 2024-10-28 16:37:39 字数 1312 浏览 6 评论 0原文

问题已解决

俗气的错误...哈哈,

对于我的时间列,当我使用毫秒时,我使用了工作表中我没有提及的列。我正在使用我的毫秒间隔列。我认为这会起作用,但忘记了我的新公式是基于特定时间,而不是自看到最后一件事以来的时间间隔。所以总和总是小于 60000。感谢您的帮助,并希望我能接受两个答案。 =)

重新审视整个问题

以下是我的一些实际价值观。我之前使用的是几秒,但在我的真实文档中我使用的是毫秒。我需要 sumoflist 列是距当前时间 60 秒的次要总和。这将是 60000 毫秒。

这是我之前使用的确切公式。是的,我输入正确,但它仍然不起作用。我必须对其进行一些修改,以便它可以与我的工作表和毫秒一起使用。

{=SUM(IF($B2-$B$2:$B2<60000,$U$2:$U2))}
{=COUNT(IF($B2-$B$2:$B2<60000,$U$2:$U2))}

求和函数将对所有它们求和,无论它们有多旧。计数也一样。

由于我给了您一小部分数据,因此使用 20000 作为示例。感谢迄今为止所有帮助过我的人!并请继续帮助我! <3


// csv for easy import
seconds,sumoflist,minorsums
800,0,0
1000,40000,40000
1200,80000,40000
1000,120000,40000
800,160000,40000
1000,200000,40000
800,240000,40000
1000,280000,40000
1200,320000,40000
1000,360000,40000
800,400000,40000
1000,440000,40000
800,480000,40000
1000,520000,40000
1200,560000,40000
1000,600000,40000
800,640000,40000
1000,680000,40000
800,720000,40000
1000,760000,40000
1200,800000,40000
1000,840000,40000
800,880000,40000
1000,920000,40000
800,960000,40000
1000,1000000,40000
1200,1040000,40000
1000,1080000,40000
800,1120000,40000
1000,1160000,40000
800,1200000,40000
1000,1240000,40000
800,1280000,40000
850,1282500,2500
900,1285000,2500
850,1287500,2500

Problem Solved

Cheesy Mistake... lol

For my time column when i was using my milliseconds i was using the column in my sheet that i was not mentioning. I was using my millisecond interval column. I thought this would work, but forgot that my new formula was based on the specific time, not the interval of time since this last thing was seen. So the sum was always less than 60000. Thanks for all your help and wish i could accept two answers. =)

Revisiting the whole question

Below are some of my actual values. I was using seconds earlier, but in my real document i am using milliseconds. I need the sumoflist column to be the sum of minorsums that are 60 seconds old from the current time. This would be 60000 milliseconds.

Here is the EXACT formula that i was using from earlier. And yes, i was entering it correctly and it was still not working. I had to modify it a little so that it would work with my sheet and milliseconds.

{=SUM(IF($B2-$B$2:$B2<60000,$U$2:$U2))}
{=COUNT(IF($B2-$B$2:$B2<60000,$U$2:$U2))}

The summing function will sum all of them, no matter how old they are. The same for the counting.

Since i gave you small chunk of the data, use 20000 for examples. Thanks to all those that have helped me so far! And please continue helping me! <3


// csv for easy import
seconds,sumoflist,minorsums
800,0,0
1000,40000,40000
1200,80000,40000
1000,120000,40000
800,160000,40000
1000,200000,40000
800,240000,40000
1000,280000,40000
1200,320000,40000
1000,360000,40000
800,400000,40000
1000,440000,40000
800,480000,40000
1000,520000,40000
1200,560000,40000
1000,600000,40000
800,640000,40000
1000,680000,40000
800,720000,40000
1000,760000,40000
1200,800000,40000
1000,840000,40000
800,880000,40000
1000,920000,40000
800,960000,40000
1000,1000000,40000
1200,1040000,40000
1000,1080000,40000
800,1120000,40000
1000,1160000,40000
800,1200000,40000
1000,1240000,40000
800,1280000,40000
850,1282500,2500
900,1285000,2500
850,1287500,2500

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

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

发布评论

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

评论(2

此生挚爱伱 2024-11-04 16:37:39

对于第一个单元格(0 旁边),输入

=SUM(IF((A:A<=A2)*(A:A>A2-60),C:C,0))

并按 CTRL + SHIFT + ENTER 确认(,将会出现 {}完成后围绕公式)。

然后往下拉。


在此处输入图像描述

看到这里,Excelll 和我提供的答案都是正确的。

对于 61.61.8 - 61.6 相加,而对于 63.254 - 63.25 相加。

为了确保这一点,{} 位于公式周围,出现在 CTRL + ALT + ENTER 之后。

即,按住 CTRL 键并按住,按住 ALT 键并按住,然后按 ENTER 键并同时释放 3。

For the first cell (next to 0), type in

=SUM(IF((A:A<=A2)*(A:A>A2-60),C:C,0))

and press CTRL + SHIFT + ENTER to confirm(, and there will be {} around the formula after you have done so).

Then drag down.


enter image description here

Here you see, the answers provided by Excellll and me are both correct.

For 61.6, 1.8 - 61.6 are summed, while for 63.25, 4 - 63.25 are summed.

To make sure, the { and } are around the formula, which appear after CTRL + ALT + ENTER.

That is, press CTRL and hold, press ALT and hold, press ENTER and release 3 simultaneously.

烟酉 2024-11-04 16:37:39

Dante Jiang的建议是正确的,但是完整的列引用会大大减慢计算速度。请尝试以下操作:

=SUM(IF($A2-$A$2:$A2<60,$C$2:$C2))

按 Ctrl+Shift+Enter 将公式作为数组公式输入。然后往下填。

Dante Jiang's suggestion is right, but the full column references slow down the calculation considerably. Try this instead:

=SUM(IF($A2-$A$2:$A2<60,$C$2:$C2))

Press Ctrl+Shift+Enter to enter the formula as an array formula. Then fill down.

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