Solver with rounding issues and running very slow with integer constraint

tropics123

Board Regular
Joined
May 11, 2016
Messages
85
Hi, I'm trying out Solver and it's very very slow! My test spreadsheet has 25 rows of test data and it ran over 30 minutes and froze all the other Excel screens, so I finally ended the task. It probably would've ran for 2 hours if I let it. Part of the issue is, the constraint is set to integers. If I removed the constraint then it ran faster. But the constrained was needed otherwise, Solver gave answers with a bunch of decimals. I contacted Microsoft Solver support and the person said it was "normal" to let Solver run for hours on her PC. That is not a feasible solution. Does anyone have any tips?

This is a test run because usually we have thousands of rows with rounding issues (multiple files every day and amounts change) and we want a more automated way to add a penny to random rows rather than manually doing that for thousands of rows. It's not a fun task :)

Here's what I'm doing:

*Last row is the total for each column
1) 1st column - Data from client. Last row shows the client expects bank to withdraw $5093.95. Problem with this is rounding. The client types in amounts on some rows up to four decimal points.
2) 2nd column - Bank only pulls up to two decimal points and the actual amount bank plans to withdraw is $5093.93, not $5093.95 (as client expected - this is amount from first column)
3) 3rd column - Since Solver can't get down to the pennies, Microsoft Solver Support suggested scaling. I took the "Data From Client" and multiplied by 100.
4) 4th column - "Solver Results" is from the Microsoft Solver Support Rep when she ran it with the integer constraint. Without the constraint, the answer would include decimal points.
5) 5th column - take the "Solver Results" and divide by 100


Data From ClientActual Data From ClientScaled data for SolverSolver ResultsAnswerDifference
234.0000234.00002340023400234.000.00
125.0000125.00001250012500125.000.00
500.0000500.00005000050000500.000.00
800.0000800.00008000080000800.000.00
88.050088.05008805880588.050.00
110.4126110.41001104111041110.410.00
190.8335190.83001908319083190.830.00
212.3040212.30002123021230212.300.00
253.7500253.75002537525375253.750.00
202.8540202.85002028520285202.850.00
191.9790191.98001919819198191.980.00
215.3669215.37002153721537215.370.00
103.0500103.05001030510305103.050.00
152.3960152.40001524015240152.400.00
211.3125211.31002113121131211.310.00
99.844099.84009984998499.840.00
32.441732.44003244324432.440.00
190.5415190.54001905419054190.540.00
0.00000.0000000.000.00
162.5000162.50001625016250162.500.00
466.8996466.90004669046691466.910.01
63.600063.60006360636063.600.00
36.131536.13003613361336.130.00
302.0835302.08003020830208302.080.00
148.6040148.60001486014861148.610.01
Total -->5093.955093.9300509,393.00509,395.005,093.95

<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>
</tbody>

<colgroup><col span="2"><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I am sorry' don't know why its complicated. I tried and i am getting both the results from my end.


Excel 2013/2016
AB
1Data From ClientResult
2234.00234.00
3125.00125.00
4500.00500.00
5800.00800.00
688.0588.05
7110.41110.41
8190.83190.83
9212.30212.30
10253.75253.75
11202.85202.85
12191.98191.98
13215.37215.37
14103.05103.05
15152.40152.40
16211.31211.31
1799.8499.84
1832.4432.44
19190.54190.54
200.000.00
21162.50162.50
22466.90466.90
2363.6063.60
2436.1336.13
25302.08302.08
26148.60148.60
275093.955093.93
Sheet9



Excel 2013/2016
AB
1Data From ClientResult
2234.00234.00
275093.955093.93
Sheet9
Cell Formulas
RangeFormula
B2=ROUND(A2,2)
B27=SUM(B2:B26)
A27=SUM(A2:A26)
 
Upvote 0
Also try formatting both the columns.

s6VquQ3.png
 
Upvote 0
Hi Sam_D_Ben, the total that the client expects the bank to withdraw is $5093.95, however, after the bank rounds to two decimal places the total is actually $5093.93 (off by two pennies). We've tried asking the client to only give numbers up to two decimal places but they won't listen. I want the Solver to get the total to $5093.95. All the changing variables the Solver returned can only be up to two decimal points. I got it to run before but after clicking on each cell in the changing variable, there were numbers it returned up to nine decimal points. I think you might've swapped the totals around on your example. The total we want Solver to achieve is $5093.95.
 
Upvote 0
I am sorry' i understand the problem, I tried but wondering why is that difference.


Excel 2013/2016
ABCD
1Data From ClientRounded figureSolvers ResultStatus
2466.8996466.90466.91Error
363.600063.6063.6
436.131536.1336.13
5302.0835302.08302.08
6148.6040148.60148.61Error
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,597
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top