Forum Discussion
paulap46
Mar 09, 2023Copper Contributor
In a column of numbers is there a way i can find if a number of cells add up to a specific amount?
In a column of numbers is there a way i can find if a number of cells add up to a specific amount?
8 Replies
Sort By
- peiyezhuBronze Contributor
- mathetesSilver Contributor
is there a way i can find if a number of cells add up to a specific amount?
An intriguing question. Is there a way for you to spell out the circumstances , the constraints, the number of cells in this hypothetical (or is it real?) column, etc.? But before venturing any further, you could help us help you by being far more detailed in describing the big picture here. What are the "rules" to be followed, if any? Are you speaking of a column of unlimited size, a specified specific amount that could approach infinity (or is there a finite limit?
- paulap46Copper ContributorI have several datasets in a column of around 20 rows each. I need to find if any of the numbers in one of the datasets adds up to a specific number, 8166.99. I didnt think it was massively complicated but seems it is!!
- Patrick2788Silver Contributor
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?