Hello everyone
I have in sheet1 a number of products 1 , 2 , 3 in column B and each product consists of 4 items A , B , C and D in column C
In column D there are different sizes of each item
In row 1 in range ("F1:Q1") there are fixed sizes that I need to see the proper size for each item
* Note : the first item "A" is essential and should occur only at least for once
* The second item "B" would be 1 or 2 or 3 or more according to the available size in row 1
---------------------------------------------------------------------------------------
Examples :
1) As for the value in F1 is 1.500 - the expected result would be in range("F5:F8")
suppose A = 1 and B =1 >> so 1 * 0.280 + 1 * 0.600 = 0.880
Now we see the proper item (from "A" or "C" or "D") that will be close to 1.500 but it must be equal to 1.500 or smaller a little than this size
If we add 0.880 + item "A" (0.280) = 1.160
If we add 0.880 + item "C" (1.800) = 2.680
If we add 0.880 + item "D" (0.880) = 1.760
NOW let's the code determine the closest area of the three results 1.160 / 2.680 / 1.760 >>> the nearest one is 1.160
Finally the result in range("F5:F8") would be as following : F5 = 2 / F6 = 1 / F7 ="x" / F8 = "x" and F9 would have the remaining size which is calculated
(1.500 - 1.160) which will equal 0.340
--->> in summary the first item "A" is essential that should be 1 at least then the second item "B" would be flexible ( 1 / 2 / 3 or more according to
the available size ) then there must be one of the three items "A" or "C" or "D" according to the remaining size (the choice will be the nearest ..
equal to less than the fixed size in row 1)
2) Another example :
In range("J11:J15") :
In J14 will be "x" as there is no size related to item "D"
item "A" will be 1 which equals to 0.060
item "C" will be 1 which equals to 1.02
item "B" will be changeable to suit the desired size in J1 so I do it manually and reached 10 as 10 * 0.080 = 0.8
Now the total of the three items will be 1.880 (0.060 + 1.02 + 0.8)
In J15 will be the remaining which is 1.900 - 1.880 = 0.020
I know this is complicated issue but I hope to find help in this topic
Thanks advanced for help
* the thread is posted here too
http://www.eileenslounge.com/viewtopic.php?f=30&t=28955
* Sample file edited a little
Bookmarks