Forum Discussion

paulap46's avatar
paulap46
Copper Contributor
Mar 09, 2023

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

    • paulap46's avatar
      paulap46
      Copper Contributor
      I am sorry I dont understand the screen when i click the link
      • peiyezhu's avatar
        peiyezhu
        Bronze Contributor

        why not share your data and expected result?

  • mathetes's avatar
    mathetes
    Silver Contributor

    paulap46 

     

    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?

    • paulap46's avatar
      paulap46
      Copper Contributor
      I 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!!
      • Patrick2788's avatar
        Patrick2788
        Silver Contributor

        paulap46 

        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?

Resources