Utilising varying amounts of cells for series of calculations - excel

I am trying to account the value of a certain amount of grain coming in and out of storage based on the amount of fees. The grain is stored in a lump sum. I am trying to calculate the value/tonne of outcoming grain utilising a first in first out type approach in Excel. I have attempted learning Python for this task but I feel like it will be a while before my ability utilising coding (something pretty foreign to me) will be at the level where I could perform this task.
For example 400 tonnes might come in at a certain value which starts accruing storage fees in May. Then in June there might be 500 tonnes come in and start accruing fees from there. In July I might decide to take 600 tonnes out of storage (obviously meaning that 400 tonnes worth of fees from June and 200 tonnes worth of fees from July). Doing this leaves 300 tonnes of grain still in storage accruing fees, spillover which is then accounted for first for the next calculation. The size of outtakes varies between being larger or smaller than the amount on intakes.
I have tried utilising a sort of mini-grid. Which implements a series of If checks to solve the issue but it's difficult to automate when an outtake requires multiple different intakes of grain (multiple rows in the column) to then go to the next untouched cell in that column after I've taken into account the "spillover" from the previous outtake.
Is there solution here that I'm missing, mainly around taking into account the differing amounts of cells required for a series of calculations?

Related

How to calculate the effort a customer type most likely require of an FTE during a year

I know how many customers of each customer-size group each sales representative handles on an annual basis. Is it possible to calculate the likely time/effort required by each customer size based on this data set? Or said differently, I'm trying to find out if larger customers require more or less effort than smaller customers.
Is there a function or formula in Excel that will allow be to answer the above based on the data set below?
To add some context, in case it is helpful. There are 2080 work hours a year. I'm assuming they spend all their time with the customers under their responsibility. I also expect that the largest customers require more time than a small customers, but I dont know how much more. That is what I'm trying to figure out. Some employees do handle a lot more customers than others, so its probably best to look a the relative difference between the customer sizes for each employee...
Customer size is rated from 0 (very small) to 7 (the largest).
Below is a small data extract of a large Data table

How to handle new investors, remove exiting investors from a fund

Heres the situation,
I've begun managing money for a handful of people in crypto markets. Each have a different sized account. Right now I am managing all of them individually, its a problem because its not scaleable and is time intensive.
So my question is how can I create something in google sheets to keep track of investor holdings in an overall fund? say there's 10 investors, each with $10,000. Each have 10%. But then a new investor comes in with 5%. How can I program this into an excel sheet?
Totally stuck. I need to be able to add/remove people, and adjust the total assets, holdings per person.
Running into a wall, and crypto forums are just exploding with activity. help.
Add a time variable (eg NumberOfDaysInvested) and multiply it by percentage each investor had originally up until new investors join in. That's a more fair way to divide the profits.
However, it still remains a problem that new investors can partake in profits obtained earlier - ie after just being an investor for 1+ days you will gain access to profits made by earlier investors.
I would suggest to look into dividing investors into funds and pools to separate them but still introduce the time variable. It will reduce overall work on your side and will be more fair.

"IF" function for analysis of hospital lab frequency

I work for a hospital that is part of a larger network. We were recently asked by our corporate overlords to address the use of a specific laboratory test. in general, this test should only be performed daily, which should be considered to corresponded to a 24 hour period from last draw. sometimes, however, based on when people arrive to the hospital (e.g. 7pm), and in the interest of bundling labs for a single draw, they may be drawn sooner to coincide with routine testing i.e. 5am. it would never be necessary to otherwise need to repeat within a short (8 hour) window, particularly on the same day.
we have been asked to validate to see if we are adhering to this general practice, as testing any more frequent than that, say, within 12h of a previous test, has no real clinical value and thus adds unnecessary cost.
To address this issue I was given a dataset that among other items includes all instances the lab was performed including collection date and time.
please see HIPPA-safe example below (to be clear, no real data and identifiers are not real); the actual dataset has over 4,174 entries corresponding to 1,328 unique persons. everyone had at least one test performed, not everyone had >1.
I THINK what I want to do is an IF formula that reads the antecedent cell to 1) check if same person and 2) if so, perform a subtraction of the time stamp to display the relevant difference in time, which I can then filter, create histogram, etc. does this seem like a reasonable approach? is there a more preferable method to facilitate analysis? do any other forms of analysis come to mind?
=IF(B2=B1, D2-D1, "n/a")
example data set with formula:
any other forms of analysis come to mind?
By the looks of it you should consider taking the values under "Results" into account, assuming there is a band that might be considered 'normal' readings. The "one in 24 hours is sufficient" rule of thumb may well be appropriate for a series of values within the 'normal' band but not so much so if readings are close to 'danger level'.
That is, in some cases a higher than 'standard' frequency of monitoring may be in the patient's interest, even if not hospital policy, so it may be worth separating the "less than 24 hours interval" readings into those where the higher frequency provided information of little value (eg readings remaining within a 'normal' band) from any that crossed into or out of the band and/or large changes in value. This though may be more a matter of statistical analysis than programming and depend upon whether any action might be taken as a result of such "extra" readings.

Excel circular reference with six simple formulas

I thought I was reasonably sharp when it comes to avoiding circular references in excel but this time am truly stuck. I have lost alot of hair over this ...
This is a simple government subsidy exercise. Users pay the government for gas. First tier of consumption is free. Second tier is subsidized. Government provides a lump contribution ($4,263m). Anything left after Revenue + Subsidy - Expenditure (for all tiers) is used to subsidize tariff of second tier.
Remaining contribution is divided by volume of demand for Tier two, and then subtracted from the tier two tariff ($15/tonne) Tier three revenue is fixed to make things simple.
I have structured the model per the image below. You can see all the formulas I have used. All rows that are not yellow are hard coded, therefore no formulas in these. I have enabled iterative calculations ... but excel just keeps on spitting wrong answers. Can someone please tell me where I am going wrong and how to solve this issue? :) Is there for example a way I can rewrite the 'subsidy available from contribution' formula to avoid the circularity?
The issue is that you should be calculating the "Tier 2 subsidized tariff" as an output - it shouldn't be an input in your calculation. Instead of the total 'funding from operations' in this calculaton you need to have a 'Tier 1 and 3 funding.' The amount of money still needed to cover operating costs will be the total revenue from Tier 2, and divide this by the Tier 2 volumne to get your $/tonne.
Formulas:
Screenshot with formulas shown
Results:
Screenshot with calculated values
If there is a chance that you'll have more revenue from Tier 3 than needed to cover all costs, you might add an 'if' statement to this to make sure your tier 2 cost doesn't go below 0.
you don't need to use formula to determine "tariff rebate". circular reference is telling you that you are dealing with x=x situation here. so if you replace numbers with variable names you end up with calculating "Subsidy Available from Contribution" without need of tariff rebate. Here is what I came up with:

How do I use Goalseek function in excel to generate a series?

am struggling with the application of goal seek function in excel. Am forecasting production for an oil well however we have a target cumulative production expected after say 20 years of production. I have produced table columns of monthly production rate and cumulative production. I would like to play (create sensitivity scenarios) with my expected cumulative production.
Can i use goal seek to change the production forecast profile per month by just changing the cumulative production at the end.
Also advise alternative functions should goal seek not be the right function for this task.
Appreciate your support
This is really just an example of what #DanK has already mentioned. Say ColumnB figures are actual production (in black) and estimates (in blue). The estimates in this case computed as number of days in the month times the factor in D1 ("daily production"). To ramp up production so that the total cumulative production (in the example below, for 1-1/2 years, rather than all 20 as in the example above), presently estimated to be 115,620 units is instead 150,000 then Goal Seek might be applied so:
whereupon the D1 value (200) should change to 287 (and the total in B19 to 150,000, and all the blue values change also). The principle should work if, say, June 2015 were calculated as 16*D1 rather than 30*D1 to allow for planned suspension of production. If that fortnight were an intervention to add production from another reservoir anticipated to be 100 per day then Goal Seek would not adjust "100 per day" but would adjust a new daily rate of 1.5*D1.

Resources