I’m trying to write formulae that will split a given number into the sum of 4 other numbers.
The other numbers are 100,150,170 and 200 so the formula would be
x = a*100+b*150+c*170+d*200 where x is the given number and a,b,c,d are integers.
My spreadsheet is set up as where col B are x values, and C,D,E,F are a,b,c,d respectively (see below).
B | C | D | E | F |
100 1 0 0 0
150 0 1 0 0
200 0 0 0 1
250 1 1 0 0
370 0 0 1 1
400 0 0 0 2
I need formulae for columns C,D,E,F (which are a,b,c,d in the formula)
Your help is greatly appreciated.
UPDATE:
Based on the research below, for input numbers greater than 730 and/or for all actually divisible input numbers use the following formulas:
MOD(x; 20)will return numbers 0 – 19,CHOOSE(x;a;b;...)will return n-th argument based on the first argument (1=>second argument, …),instead of;based on your Windows language®ion settingslet’s start with the assumption that you want to preferably use 200s over 170s over 150s over 100s – i.e.
300=200+100instead of300=2*150and follow the logical conclusions:the result set can only contain at most 1
100, at most 1150, at most 4170sand unlimited number of200s(i started with 9170sbecause 1700=8×200+100, but in reality there were at most 4)there are only 20 possible subsets of (100s, 150s, 170s) – 2*2*5 options
930 is the largest input number without any
200sin the result setbased on observation of the data points, the subset repeats periodically for
number = 740*k + 10*l, k>1, l>0– i’m not an expert on reverse-guessing on periodic functions from data, but here is my work in progress (charted data points are from the table at the bottom of this answer)the functions are probably more complicated, if i manage to get them right, i’ll update the answer
anyway for numbers smaller than 740, more tweaking of the formulas or a lookup table are needed (e.g. there is no way to get 730, so the result should be the same as for 740)
Here is my solution based on lookup formulas:

Following is the python script i used to generate the data points, formulas from the picture and the 60-row table itself in csv format (sorted as needed by the
matchfunction):