Discussion Re: Formula/VBA Help in Excel
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2996844#M123387
<P><LI-USER uid="1222494"></LI-USER> Sorry, but I don't understand the logic of your desired result, but perhaps I misunderstood again. My formulae now look at Store 1 first and fulfills the order with all it has. Then Store 2 fulfills what's left and so on. So for the first order, Store 1 fulfills 47 out of 48 and Store 2 fulfills 1 more. All other stores are zero.</P>Tue, 23 Nov 2021 12:09:45 GMTRiny_van_Eekelen2021-11-23T12:09:45ZFormula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2979488#M122763
<P>Please assist me in below situation</P><P><BR />In A column, I have a Quantity which are required to fill "X" store, but this should be fetch from other Stores lets say 1,2,3,4,5,6</P><P><BR />Condition is if my store #1 has less qty than what I need in A column for store X, then it should return zero (should not give anything), and run the logic in next column with different store.</P><P>But if Quantity in Store 1 is greater than what is required for Store X, then it should check the difference and assigned the quantities which is required by X store (nothing more).</P><P>IF store x need 50 qty but store 1 only able to fulfil 40 then for remaining 10 quantities it will check in next store and so on.</P><P><BR />Note: if store 1 has 151 quantity and can fulfil required 50 quantity for X store then it will only give 50 not 51, and when formula move to anotehr colum then it should come as 0, cause required quantity is already fulfilled by previous stores.</P>Thu, 18 Nov 2021 09:40:50 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2979488#M122763sherikhan882021-11-18T09:40:50ZRe: Formula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2980838#M122818
<P><LI-USER uid="1222494"></LI-USER> Don't think you need to "Excess" columns, by the way. And the logic you want to apply seems to cause trouble. You say that if Store1 doesn't have enough on hand, it should be skipped, with the same logic applied to the following stores.</P><P>Suppose the quantity of the first order would be 101, rather than 47, then none of the stores would be selected. Wouldn't it make more sense to say that store 1 delivers 47, store2 50 and store 3 the remaining 4. Or, store 3 delivers all of their 92 items and store 1 delivers 9 more (or any other combination of stores for that matter).</P><P> </P><P>Anyhow, the attached file does what you ask for, unless I completely misunderstood. Note that I changed the formulae in the "Excess" columns to something without IF, hoping you find it useful.</P>Thu, 18 Nov 2021 15:33:25 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2980838#M122818Riny_van_Eekelen2021-11-18T15:33:25ZRe: Formula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2996677#M123380
Hi Riny,<BR /><BR />first of all thank you so much to respond to my query and giving your valuable time.<BR /><BR />"Wouldn't it make more sense to say that store 1 delivers 47, store2 50 and store 3 the remaining 4" yes this is what i need.<BR /><BR />I don't need excess column you are right, I just put it there to see what is the excess quantity in 1 to 6 stores from Column A ( which is required in Store X).<BR /><BR />So Store X need certian qty which is mentioned in column A which has to be fulfilled from rest of 6 stores. Issue which i cannot able to solve is, if my fulfilment store will only contribute if they have extra quantity with them ( greater than A column).<BR /><BR />Lets Say<BR /><BR />1) Store X need 48 qty. My fulfilment store 1,2,3---- has 48,50,100,110 qty, then formula should check what is the qty required by store x and then it started to go to every store and see if its more or less then required qty. then if its less, system will skip that store, if its more then it will metch the max quantity it can fetch to fulfil the requirement but not more then the requirement.<BR /><BR />Please check the attached file.Tue, 23 Nov 2021 11:27:35 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2996677#M123380sherikhan882021-11-23T11:27:35ZRe: Formula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2996695#M123381
<P><LI-USER uid="403176"></LI-USER> PFA</P>Tue, 23 Nov 2021 11:29:04 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2996695#M123381sherikhan882021-11-23T11:29:04ZRe: Formula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2996844#M123387
<P><LI-USER uid="1222494"></LI-USER> Sorry, but I don't understand the logic of your desired result, but perhaps I misunderstood again. My formulae now look at Store 1 first and fulfills the order with all it has. Then Store 2 fulfills what's left and so on. So for the first order, Store 1 fulfills 47 out of 48 and Store 2 fulfills 1 more. All other stores are zero.</P>Tue, 23 Nov 2021 12:09:45 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2996844#M123387Riny_van_Eekelen2021-11-23T12:09:45ZRe: Formula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2996943#M123391
<P><LI-USER uid="403176"></LI-USER> Thanks again.</P><P> </P><P>I work in retial, we have item codes which needs to be allocated from warehouse to store. Lets say there are few item codes for which stock in warehouse is zero, and one of the store is selling those items alot due to which it runs out of stock, this is my X store and after doing some calculation my system tells that hey sheri, you X store need 47 qty for one week. <BR /><BR />Now, I do not have that item available in warehouse so the option is to fetch the stock from other store.<BR />But other store also need some stock to sell (Minimum Display Quantity-MDQ), here in Column A (which is also the qty required by Store X) we mentioned the MDQ for all the remaining store.<BR />I do not want to fecth anything extra from any store which is not meeting MDQ, and I also do not want to fetch anything extra if the quantity is fulfil. <BR /><BR /></P><P>in my first example, My MDQ/or Store X requirement is 48.</P><P>My store 1 has 47 Qty available, since store 1 stock is less than 48, I do not want to consider this stock for donation.</P><P>Now I will check my second store, which has 50 qty, means 2 item extra. So system should take 2 items now the remaining qty required is (48-2=46), then i will see if my third store can fulfil it.<BR /><BR /></P><P>My third store has 92 qty= 92 is greater than 48, =92-48= 44. Store 3 can give 44 and i need 46, so we will take 44 from store 3, remaining quantity is =48-(2+44)= 2, so i will check store 4</P><P> </P><P>My store 4 has 100 qty, and its greater than 48, so it can fulfil my requirement, but now i just need 2 qty. though it can give me 52. So here i want that i will only get 2 qtyamd when I go for next store, no matter how much qty it has it will say 0. </P>Tue, 23 Nov 2021 12:58:09 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2996943#M123391sherikhan882021-11-23T12:58:09ZRe: Formula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2997257#M123408
<P><LI-USER uid="1222494"></LI-USER> Quite some logic but I think I got it. See attached. It's an ugly formula and probably can be optimized. </P>Tue, 23 Nov 2021 14:15:31 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2997257#M123408Riny_van_Eekelen2021-11-23T14:15:31ZRe: Formula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2997574#M123420
<P><LI-USER uid="403176"></LI-USER> You're Awesome!!! Not only you understand and solved my issue. But gave your valuable time to me. <BR /><BR />I kept thinking about the solution for entire day, when i posted it but unable to put the logic into formulas. <BR /><BR />You will be remembered by rest of my generation ! Thank you for all you help.</P>Tue, 23 Nov 2021 15:14:18 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2997574#M123420sherikhan882021-11-23T15:14:18ZRe: Formula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2997663#M123424
I didnt even know, if we can use Max function like this <LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"></LI-EMOJI><BR /><BR />GeniusTue, 23 Nov 2021 15:28:50 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2997663#M123424sherikhan882021-11-23T15:28:50ZRe: Formula/VBA Help
https://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2997687#M123427
<P><LI-USER uid="1222494"></LI-USER> Glad it worked!!</P><P> </P>Tue, 23 Nov 2021 15:41:39 GMThttps://techcommunity.microsoft.com/t5/excel/formula-vba-help/m-p/2997687#M123427Riny_van_Eekelen2021-11-23T15:41:39Z