ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   calculate values (https://www.excelbanter.com/new-users-excel/76747-calculate-values.html)

galbertse

calculate values
 

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
------------------------------------------------------------------------
galbertse's Profile: http://www.excelforum.com/member.php...o&userid=32383
View this thread: http://www.excelforum.com/showthread...hreadid=521472


Gary''s Student

calculate values
 
Do you need exactly 8 numbers. Suppose we can reach 360 by only adding two
or three?
--
Gary's Student


"galbertse" wrote:


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
------------------------------------------------------------------------
galbertse's Profile: http://www.excelforum.com/member.php...o&userid=32383
View this thread: http://www.excelforum.com/showthread...hreadid=521472



galbertse

calculate values
 

Yes it needs to be eight numbers


--
galbertse
------------------------------------------------------------------------
galbertse's Profile: http://www.excelforum.com/member.php...o&userid=32383
View this thread: http://www.excelforum.com/showthread...hreadid=521472


[email protected]

calculate values
 
"galbertse" wrote:
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)?


All times are GMT +1. The time now is 04:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com