Best fitting a range of data to a particular value
- From: eaton.rob@xxxxxxxxx
- Date: 7 Apr 2006 19:21:53 -0700
Hi,
I am struggling to find the answer to the following:
I have three columns of data, consisting of up to ten values.
I need to search through this data and find the best combination to
fulfill a value. Ie I have a value X which is made up of ONE value from
range A, possibly ZERO to THREE values from range B and possibly ZERO
to TWO from range C.
Eg.
Range A: 150,300,450,600,900,1200,1500,1800,2100,2400
Range B: 150,300,450,600,900,1200,1500,1800,2100,2400
Range C: 50,75,100,150,200,250
I require a result in the form of a table that I can tabulate the
quantities for each size in each range. Choosing the largest possible
value from each range until it is unable to fit any more from that
range.
if X=3200 then the result would be:
1x2400 (from range A)
1x600, 1x150 (from Range B)
1x50 (Range C)
any 'left over' would be less than 50.
if X=555
the result would be:
1x450 (from range A)
1x50 (from range C)
Cheers guys in advance. I've tried various ways using IF statements,
not sure if LOOKUP will work and also tried VBA using FOR loops to no
luck.
Regards,
Rob
.
- Prev by Date: if statement question
- Next by Date: Select every Nth cell in column? Help please
- Previous by thread: if statement question
- Next by thread: Select every Nth cell in column? Help please
- Index(es):
Relevant Pages
|