Forum Discussion

tcteng71's avatar
tcteng71
Copper Contributor
May 23, 2020

Whole number for answer in Excel solver

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

  • wumolad's avatar
    wumolad
    Iron Contributor

    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

     

Resources