Integer iterations in solver

  • Thread starter Thread starter Stevie D
  • Start date Start date
S

Stevie D

Hello, I am trying to solve the following a puzzle:

A farmer has exactly £100 to buy exactly 100 animals (He must spend all the
money and he must buy exactly 100 animals - at least one of each type).

The animals are:

Sheep which cost £0.05,
Pigs which cost £1.00
and Cows which cost £5.00.

I have tried using solver to crack this problem (I am assured there is a
solution) but the answers I'm getting include decimal places (using the
solver) that changes the values in three cells.

Excel finds a solution but uses fractions of an animal where only whole
animals are used in the solution.

Is it possible to force the solver to use exact integer values?
 
Sure, just add constraints within Solver making the adjustable cells
integer.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------­------------------------------­----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------­------------------------------­----------------
 
Only read if you get stuck:-----------------













Scroll down
















And down














80 Sheep at 0.05 = 4.00
1 Pig at 1.00 = 1.00
19 Cows at 5.00 = 95.00
 
Solver will try to get integer solutions when asked but depending on the
setting of Tolerance the results may be values such as 6.9999 instead of 7
best wishes
 
Back
Top