Whole number for answer in Excel solver

%3CLINGO-SUB%20id%3D%22lingo-sub-1413500%22%20slang%3D%22en-US%22%3EWhole%20number%20for%20answer%20in%20Excel%20solver%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1413500%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20i%20tried%20to%20follow%20the%20example%20from%20Danny%20Rock%20%22How%20to%20use%20the%20solver%20in%20excel%22%2C%20but%20the%20sales%20qty%20and%20qty%20left%20turn%20out%20in%20decimals%20instead%20of%20whole%20numbers.%20Have%20I%20missed%20anything%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1413500%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1414226%22%20slang%3D%22en-US%22%3ERe%3A%20Whole%20number%20for%20answer%20in%20Excel%20solver%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1414226%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F677703%22%20target%3D%22_blank%22%3E%40tcteng71%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20want%20the%20result%20to%20be%20a%20whole%20number%2C%20you%20need%20to%20include%20the%20cells%20as%20constraints%20and%20allocate%20them%20as%20integers.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EClick%20the%20%22Add%22%20button%20under%20Constraints%20to%20launch%20the%20%22Add%20Constraints%22%20dialogue%20box.%26nbsp%3B%3C%2FP%3E%3CP%3EEnter%20the%20name%20of%20the%20cell%20in%20the%20%22Cell%20Reference%22%20box%2C%20or%20highlight%20a%20range%20of%20cells%20with%20your%20cursor%20to%20fill%20this%20box%20automatically.%3C%2FP%3E%3CP%3EClick%20the%20drop-down%20menu%20in%20the%20middle%20of%20the%20%22Add%20Constraints%22%20dialogue%20box%2C%20and%20select%20%22int%22%20from%20the%20menu.%20The%20word%20%22integer%22%20will%20appear%20in%20the%20Constraint%20box.%3C%2FP%3E%3CP%3EThen%20click%20%22OK%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi, i tried to follow the example from Danny Rock "How to use the solver in excel", but the sales qty and qty left turn out in decimals instead of whole numbers. Have I missed anything?

1 Reply

Hi @tcteng71 

 

If you want the result to be a whole number, you need to include the cells as constraints and allocate them as integers.

 

Click the "Add" button under Constraints to launch the "Add Constraints" dialogue box. 

Enter the name of the cell in the "Cell Reference" box, or highlight a range of cells with your cursor to fill this box automatically.

Click the drop-down menu in the middle of the "Add Constraints" dialogue box, and select "int" from the menu. The word "integer" will appear in the Constraint box.

Then click "OK"

 

Cheers