Finding all combinations of values that add up to a given sum is a common problem in data analysis. For example, you may want to know all possible combinations of items that can be purchased with a given budget, or all possible ways to allocate resources to meet certain requirements. Continue reading
by
Comments page 2. Total comments: 62
Hi, may I ask if column A is combines data separate with comma and the value is 1,2,3 and column B is another cell with a combined date 7,8,9 . How can I come up with the formula to get the results of the first number show in column A to multiply the first number in column B and so on for example like (1*7)+(2*8)+(3*9)? Thanks.
Hi!
You cannot multiply text strings. Split the numbers into cells using these guidelines: Split string by delimiter or pattern, separate text and numbers.
Also, you can use TEXTSPLIT function.
Then multiply these numbers as you want.
For a large data sets, Excel goes "Not responding" and I have observed that it uses only 2 thread of my 12 thread CPU, how can we tweak it to support multi threading.
Hi!
Use Excel Options - Advanced - Formulas - Enable Multi-Threaded Calculation
Hi Alexander,
Thank you for your prompt response, even though it is enabled, excel still uses 2 threads.
Also, how can we make changes to the formula if we wish to find the combinations using a set of specified number. For example, if we have 14, 80, 6, 60, 15, 25, 90, 3, 7 and we want to find all sets of 3 which would add upto 100
Use the tools presented in this article to find all combinations of numbers and select the ones you want.
I somehow managed to solve the set requirement. Would greatly appreciate if you could help with multi-threading challenge
Suppose I have a list of range as follows:
15
25
32
53
85
45
14
46
45
32
40
85
I wish to get the combination of all possible numbers which on adding gives me the value between 145 to 150 (inclusive both).
There can be multiple combinations possible which gives me the value between 145 to 150 but find all of them manually is not so easy.
Is there any way we can get my required result through Excel .
Please tell me the way.
Hi!
Find all possible combinations for each of the numbers in the range you specify with a custom function or macro.
Could you send me that micro code.
How to find all combinations of numbers that equals (say, 25000) or falls between a range (say, 22,500-25,000) of given sum in Excel.
Is it possible to find the sum of numbers that is within a range ?
If yes please tell me how.
To find all combinations of numbers that equal a given value, say 25000, use one of the methods described in this tutorial. For finding a sum that falls within a range, we don’t have a ready-made solution at the moment, sorry. Writing such code will take a while.
To find the sum of numbers within a range, use the SUM function :)