Forum Discussion
How do I add or sum until?
What you have appears to be a FIFO calculation. The odd thing, though, is that you appear to be inferring the outputs (fuel used) from the future inputs (volume purchased). An explicit statement of outputs would be helpful, especially since your rules are difficult to follow.
I have attached a 356 file that uses a FIFO function but it is far from simple to follow.
- iwaddoJun 24, 2024Copper Contributor
Hi, thank you, I will take a look at your example.
I am trying to work the cost of the fuel used based on the volume purchased. Assuming the tank is always filled to capacity then the 20 litres I’ve just put in replaced 20 litres I purchased at a previous price. The 20 litres may be just the last fill-up or may need to include a number of previous fill-ups.
Does this mean I am trying to use a Last In First Out calculation?
Does this help?
- PeterBartholomew1Jun 25, 2024Silver Contributor
It does appear that you are applying LIFO accounting to your task. Assuming you never run the tank dry, your valuation will always include the first few litres priced at the original cost per litre. I have never had cause to implement a LIFO calculation. Looking it up, I see that it is a banned accounting practice in all economies other than the United States! To think, I would never have known that had it not been for your question.
- iwaddoJun 27, 2024Copper Contributor
I doubt my little home project will get me into much trouble 🙂
I just need to work out how to do it.
Thank you for your help.