calculate values

  • Thread starter Thread starter galbertse
  • Start date Start date
G

galbertse

I have a column with 25 values in it. I would like excel to SUM eight of
these cells to a total value of 360 or less. The eights cells needs to
be identified and the total must be as close a possible to 360. Is this
function possible in excel?
 
galbertse said:
I have a column with 25 values in it. I would like excel
to SUM eight of these cells to a total value of 360 or less.
The eights cells needs to be identified and the total must
be as close a possible to 360. Is this function possible in excel?

With VBA, "anything" is possible in Excel. The question is:
how much pain can you tolerate?

First, you need to look more than 1.08 million combinations
of 8 out of 25 values to find an answer. I think that requires
VBA.

Second, your requirements are unclear, and that affects the
potential complexity of any (VBA) solution.

For example, what do you mean by "the cells need to be
identified"? Do you mean the 8 values? Or do you want
the cell references (locations)?

Also, if there are multiple solutions (e.g. 4 sets of 8 that all
sum to 360), is it sufficient to output just one? Or do you
want them all? The latter could complicate usability -- the
ease with which you can use any (VBA) solution because
the size of the result is unpredictable.

Finally, where do you want the solution put? Do you want
a function that puts the result into the spreadsheet? Or is
it sufficient to display the results in a pop-up (msgbox)?
 
Back
Top