Hi BK,
Thanks for contacting us and sorry for the inconveniences,
https://stephenlnelson.com/articles/optimization-modeling-solver-excel/
I understand that you want to use a binary constraint to restrict some of your variables to be either 0 or 1, but you keep getting an error message that says "Binary Constraint Cell Reference must include only Variable Cells." I'll try to explain what this error means and how to fix it.
The error message that you are getting means that you are trying to apply a binary constraint to a cell that is not a variable cell. A variable cell is a cell that contains a value that can be changed by Solver to find the optimal solution. A variable cell must be included in the By Changing Variable Cells box on the top of the Solver Parameters dialog box . A binary constraint can only be applied to a variable cell, not to a cell that contains a formula, a constant, or a reference to another cell .
To fix this error, you need to make sure that the cell reference that you enter in the Cell Reference box for the binary constraint is a variable cell. For example, if you have a variable cell in A1 that represents the binary decision variable x, and you want to add a binary constraint to it, you need to enter A1 in the Cell Reference box, and then select bin from the drop-down list box. You can also select the cell directly from the spreadsheet by clicking the icon next to the Cell Reference box .
If you have multiple binary decision variables, you can enter them as a range or as a list separated by commas in the Cell Reference box. For example, if you have variable cells in A1, A2, and A3 that represent the binary decision variables x, y, and z, and you want to add a binary constraint to them, you can enter A1:A3 or A1,A2,A3 in the Cell Reference box, and then select bin from the drop-down list box . ***Note: This is a non-Microsoft websites. The page appear to be providing accurate, safe information. Watch out for ads on the site that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.***
I hope this helps!
Regards, Sola