在等于或大于输入的元素中找到最后一个元素(公式,无VBA)
我认为这很棘手。
我正在尝试制作一个存储桶系统,在其中您输入一个数字,然后将单元格总结到等于或大于您的数字之前。然后选择该单元格。
例如下面。
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.
Pretty easy algorithm to do in a macro but I'm trying to avoid VBA.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
= Xlookup(B1,Scan(0,B3:B10,Lambda(κ,λ,κ+λ)),A3:A10,,1)
=XLOOKUP(B1,SCAN(0,B3:B10,LAMBDA(κ,λ,κ+λ)),A3:A10,,1)
如果您使用助手列会更容易。根据我的下面屏幕截图,我使用
= sum($ b $ 3:$ b3)
to c3 单元格,然后拖动直到需要。然后使用以下公式获得所需的结果。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.