Forum Discussion
In a column of numbers is there a way i can find if a number of cells add up to a specific amount?
I believe I know what you're getting at with this request. One way to approach this task is to simplify and then scale it up once a solution has been found.
Let's say there are four numbers: 1, 2 , 3, 4
Goal: Without repeats, I'd like to find all the possible combinations that add up to 5.
For example:
1 and 4
2 and 3
The COMBIN function is used to obtain the number of a possible combinations without a number repeating. If you run COMBIN 4x as such:
=COMBIN(4,1)
=COMBIN(4,2)
=COMBIN(4,3)
=COMBIN(4,4)
Total combinations from all: 16
Approaches to finding a solution:
1. Create a recursive lambda
2. Generate all the possible number combinations (eg. the COMBIN results) for a given set of data and then filter out the ones that add up to expected total.
3. Solver?
Does this summarize your request accurately?
- paulap46Mar 14, 2023Copper ContributorYep that summarises exactly what i need. I have looked at Solver and it blew my mind!