Forum Discussion
FIFO Inventory Formula Challenge
Robert
I appreciated your description of the problem and your analysis of solution requirements. I also learn from the detailed techniques that have been deployed to make a formula more concise, though that has never been an objective of mine. My shortcoming is that I find 'concise' notations, such a regular expressions (RegEx), fiercely difficult to read.
I wish I could think up competition rules for 'the clearest top-down solution strategy' in which it is the number of overall operations that count. In my solution, posted on 13 Feb, I used Charles Williams FastExcel functions to solve the problem as an accumulate/minimise/difference sequence. That itself is simply a solution strategy to the generic problem of 'allocate an amount to consecutive bands' (e.g. the allocation of taxable income across tax bands). Your challenge is the same problem and could also be solved without placing limits on the purchasing policy that ensure only the final two tranches are present within the residual stock. Having got an ACCUMULATE function, I now need an ALLOCATE function.
Once the LAMBDA functions are released, one could imagine a challenge of:
Solve Twifoo 's year2 problem for all 5 products within a single recursion formula.
To return to the topic, I think the ingenuity required to create the problem is even more impressive than its solution; congratulations.
- PeterBartholomew1Feb 28, 2021Silver ContributorPostscript. I am not sure that I will be posting on this forum again. I have booted up an old computer that still recognises my user credentials but, on my current computer, I cannot get past the Community Registration page that insists I set up a new profile. All that because I logged on to a client SharePoint with credentials they provided!
- lori_mMar 01, 2021Iron Contributor
Hoping you manage to resolve those issues, I have gleaned much from examining the structured approach you take to problems. One take away from the present challenge is the advantage of the modern code-style LET / LAMBDA solutions over the old "mega formula" approach which I'm only too happy to have left behind now. As with many things, it is the journey not the destination that counts - especially when the resulting formulas start to bear resemblance to entries for a code obfuscation contest 🙂
- TwifooMar 01, 2021Silver Contributor
Were it not for your perhaps inadvertent qualification of my formula challenge as resembling a code obfuscation contest, I would have been completely delighted by your thesis that it is the journey that counts, not the destination, To eliminate any iota of ambiguity, let me clarify that I like legacy formulas, for they provide the logical path, but I love modern formulas, for they provide the shortest path, towards my ultimate solution!
- SergeiBaklanFeb 28, 2021Diamond Contributor
PeterBartholomew1 , why don't you ask techcommunity@microsoft.com to help?