Research Ideas and Outcomes :
Research Idea
|
Corresponding author: Prasanth Sambaraju (prashanth.kng1@gmail.com)
Academic editor: Editorial Secretary
Received: 07 Dec 2021 | Accepted: 22 Feb 2022 | Published: 25 Feb 2022
© 2022 Prasanth Sambaraju
This is an open access article distributed under the terms of the Creative Commons Attribution License (CC BY 4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Citation:
Sambaraju P (2022) Use of Worksheet events in Excel to save solver objective cell value from each iteration. Research Ideas and Outcomes 8: e79006. https://doi.org/10.3897/rio.8.e79006
|
|
Solver is a Microsoft Excel add-in program which is used to find an optimal value for a formula in the objective cell. Solver accomplishes this either by maximizing, minimizing or setting the objective cell value to a specific value. The article presents the utility of in built worksheet events in Excel VBA to save the value of objective cell from each iteration when solver is used for optimization.
Solver, Worksheet events, Iteration
Solver has been used in numerous and diverse applications (
Biochemical oxygen demand (BOD) is used as measure of the pollution produced by domestic and industrial wastes. The data shown in Table
Incubation x (days) |
BOD (mg/L) y |
1 |
109 |
2 |
149 |
3 |
149 |
5 |
191 |
7 |
213 |
10 |
224 |
\(Y = {b_1*(1-exp{(-b_2*x)})}\) (1)
Y is the exponential model describing BOD
b2 is the rate constant (parameter 1)
b1 is the BOD value (parameter 2)
x is incubation time in days
a) Data is entered in Excel, incubation days (x) in column A and BOD values (y) in column B.
b) Initial values for b1 and b2 are set to 100 and 0.75 in cells F2 and F3.
c) Y calculated was obtained by substituting b1, b2 and corresponding x values in equation (1).
d) Sum of squared errors (SSE) was obtained by squaring the difference between Yobs and Ycalc.
e) Open Solver (In Excel 2013 it is located Data tab). The dialogue box is shown in Fig.
f) Solver also option of showing the iteration results (Refer to Fig.
g) When the show iteration results is selected the following message is displayed, it prompts the user either to continue, stop or save scenario (Refer Fig.
h) The user has to manually select an option to show results of each iteration. This would considerably increase the time for reaching an optimal solution.
i) The results obtained for parameters b1, b2 and SSE after solver implementation matched with the reported values (
The worksheet change event macro (as shown in Fig.
This article demonstrates the use of Excel worksheet events to obtain the objective cell values after each iteration. The number of objective cell values obtained is dependent on the constraint precision value.
BOD data and macro to save each objective cell value during solver implementation.