View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Maistrye Maistrye is offline
external usenet poster
 
Posts: 1
Default Finding pieces of a value in a table


root Wrote:
Suppose I have a set of data below. I know that that a combination of
some values in dataset make up a value of 252. What is the most
efficient formula to find and isolate these values?
34
3
34
34
33
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51


You might want to look up "SUBSET SUM" on the internet. If you know
what it means, this problem is NP-C. Basically, that means that in
general you won't be able to find a solution very fast.

If you only have a few numbers, like above, you can probably figure it
out by just trying all possibilities until you find one that works.
It's going to be harder to do in excel as with 22 values, there are
2^22 or about 4.2 million combinations. Your options are probably
limited to VB, the Solver, or guess and test. IMO, VB is probably the
better choice to run through all the possibilities and return one that
works. (You might be able to guess and test with these numbers
though... just my opinion.)

Scott


--
Maistrye
------------------------------------------------------------------------
Maistrye's Profile: http://www.excelforum.com/member.php...o&userid=36078
View this thread: http://www.excelforum.com/showthread...hreadid=563728