在等于或大于输入的元素中找到最后一个元素(公式,无VBA)

发布于 2025-02-03 08:12:38 字数 448 浏览 5 评论 0原文

我认为这很棘手。

我正在尝试制作一个存储桶系统,在其中您输入一个数字,然后将单元格总结到等于或大于您的数字之前。然后选择该单元格。

例如下面。

Input is 3. 
A = 0
A+B = 1
A+B+C = 3 
Answer is C

Input is 4
A+B+C = 3 
A+B+C+D = 6
Answer is D because it's the next bracket up. 

在宏中可以做的算法非常简单,但我试图避免VBA。

I think this is a tricky one.

I'm trying to make a bucket system where you put in a number and you sum up cells in a line until they are equal to or larger than your number. Then you select that cell.

EG below.

Input is 3. 
A = 0
A+B = 1
A+B+C = 3 
Answer is C

Input is 4
A+B+C = 3 
A+B+C+D = 6
Answer is D because it's the next bracket up. 

enter image description here

Pretty easy algorithm to do in a macro but I'm trying to avoid VBA.

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

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

发布评论

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

评论(2

享受孤独 2025-02-10 08:12:38

= Xlookup(B1,Scan(0,B3:B10,Lambda(κ,λ,κ+λ)),A3:A10,,1)

=XLOOKUP(B1,SCAN(0,B3:B10,LAMBDA(κ,λ,κ+λ)),A3:A10,,1)

话少情深 2025-02-10 08:12:38

如果您使用助手列会更容易。根据我的下面屏幕截图,我使用= sum($ b $ 3:$ b3) to c3 单元格,然后拖动直到需要。然后使用以下公式获得所需的结果。

=@FILTER(A3:C10,C3:C10>=B1)

It would be easier if you use a helper column. As per my below screenshot I have used =SUM($B$3:$B3) to C3 cell and drag down till need. Then use below formula to get desired result.

=@FILTER(A3:C10,C3:C10>=B1)

enter image description here

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