使用VBA优化大型数据集(求解器不起作用)
我有大量数据,需要在这些数据上获得一组到达所需数字的值。更确切地说,我拥有每张ID号的超市门票以及向客户收取的金额。
我必须拿起将添加到特定号码的门票(假设1,000,000美元)。我尝试使用求解器,其中在一列中您使用二进制1/0变量,然后只需sumif即可使求解器选择的目标值累加到目标值1M。但是,当样本很小时,这起作用。我刚刚收到的文件有超过280,000张票,因此求解器无法处理该数量的二进制变量。
如何在一列中获得总计1,000,000票的门票数量?我尝试使用“ while”循环,但我的计算机在5分钟左右后崩溃。有什么想法吗?
谢谢!
I have a large set of data on which I need to obtain a set of values that reach to a desired number. To be more precise, I have supermarket tickets each of them with one ID number and the amount that was charged to the customer.
I have to pick up tickets that add to a specific number (let's say 1,000,000 USD). I tried using solver where in one column you use a binary 1/0 variable and then just sumif to get the ones that solver selects that add up to the target value of 1M. However, this works when the sample is small. The file i just got has over 280,000 tickets, so there is no way solver can handle that number of binary variables.
How can I get in one column the number of tickets that add up to 1,000,000? I tried using a "while" loop but my computer crashes after 5 min or so. Any ideas?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是你想要的吗?在A1:A11中输入逻辑。
结果
或,也许是这样。在A1:A41
8 中输入此内容
6
3
2
6
10
9
4
12
8
6
1
8
10
8
14
10
9
12
12
14
6
4
3
4
4
4
0
6
10
4
9
6
3
11
12
10
7
12
8
8
将92放在单元B1中,并运行此VBA。
Is this what you want? Enter the logic in A1:A11.
Result
Or, maybe this. Enter this in A1:A41
8
6
3
2
6
10
9
4
12
8
6
1
8
10
8
14
10
9
12
12
14
6
4
3
4
4
4
0
6
10
4
9
6
3
11
12
10
7
12
8
8
Put 92 in cell B1, and run this VBA.