Results 1 to 2 of 2

Thread: Alternative to solver, numbers (no more than 5) add up to goal, several hundred rows
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular nikio8's Avatar
    Join Date
    Oct 2017
    Posts
    123
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Alternative to solver, numbers (no more than 5) add up to goal, several hundred rows

    Hi team,
    I have a bit strange problem. Quite often one payment needs to be split to several invoices.
    Most days there are no issues, however some days this split data total does not add up to original number. If there is a difference I would like to use some formula to try to find combination of available numbers that add up to the diff. I could use solver, but it can only handle around 25 rows (using sumproduct col1 are numbers, col2 are either 1s or 0s). I tried simple for loop inside for loop inside for loop, if two or three numbers add up to an amount, but it is a bit clunky.

    Can anyone think of an alternative, please?

    Original data
    100.1
    200.2
    300.3

    Split
    100.1
    200.2
    301.3
    -1.00
    50.4

    Here, problem is easy. But this 50.4 can be combination of many numbers.

    I only started looking into this issue recently, so I need to reconcile lots and lots of old data.
    In the future i will add an index column, if data is split and sorted it will still have index number or someone can think of something better.


    Thanks in advance
    Nick

  2. #2
    Board Regular nikio8's Avatar
    Join Date
    Oct 2017
    Posts
    123
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Alternative to solver, numbers (no more than 5) add up to goal, several hundred rows

    This website is ok, but only finds one match. Perhaps that is all I need as I will try to remove as much data as possible before working on data.
    https://www.extendoffice.com/documen...given-sum.html

    not the easiest formula to understand
    Code:
    =IF(ISNUMBER(MATCH(ROWS($1:1),IF(INDEX(MOD(INT((List2-1)/2^(TRANSPOSE(List1)-1)),2),MATCH(TRUE,MMULT(MOD(INT((List2-1)/2^(TRANSPOSE(List1)-1)),2),Range1)=$C$2,0),),TRANSPOSE(List1)),0)),"X",""), and press Shift + Ctrl + Enter

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •