Circular Cell Reference - excel

I have a question regarding a circular cell reference. I have come up with an example that illustrates my dilemma and I attached an illustration.
Here's the deal. My house needs heat and it needs electricity:
My house needs 7 units of heat and 1 unit of electricity.
My generator is 50% efficient. So for every unit of electricity used to power the generator, I only get .5 units of electricity for my house. You can neither create nor destroy energy, so the other 50% that isn't turned into electricity, turns into heat.
My heat pump consumes 1 unit of electricity in order to produce 2 units of heat. This means that the heat pump is 200% efficient. Additionally we get to use the waste heat from the generator.
Please look at the attached example. I drew out the scenario so you can visualize it. Subscript E is used to denote electricity. Subscript H is used to denote heat.
I need to be able to change the generator efficiency, heat pump efficiency, and how much electricity the house needs.​ I would like to be able to manipulate each variable.
Can anyone help me input this into excel???
Thanks!!!
-Jon
Example of Scenario

Although I doubt the physical correctness of your approach, the math problem is solvable in Excel with goal seek.
Let's have the following sheet:
Formulas:
C4: =-(C2*B4)
D4: =-(C2+C4)
C6: =-(C4+C8)
D6: =-(C6*B6)
D8: =-(D4+D6)
D10: =D8/C8
Consumption are negative values, production are positive values.
Now change the variables, for example B4, B6 or C8 and call What-If Analysis, Goal Seek. D10 must be 7 and C2 is the changing cell.
A real math solution would be:
Generator Input = gi
Generator Efficiency = geff
Heat Pump Efficiency = hpeff
House Electricity Needed = hen
House Heat Needed = hhn
(gi*geff - hen) * hpeff + gi*(100%-geff) = hhn
gi*geff*hpeff - hen*hpeff + gi*(100%-geff) = hhn
gi*geff*hpeff + gi*(100%-geff) = hhn + hen*hpeff
gi * (geff*hpeff + (100%-geff)) = hhn + hen*hpeff
gi = (hhn + hen*hpeff ) / (geff*hpeff + (100%-geff))
6kW = (7kW + 1kW*200%) / (50%*200% + (100% - 50%))
6kW = 9kW / 1,5

You can rearrange this a little to make it more simple.
You're trying to solve for a + b:
a = Heat Pump Input
b = Generator Input
With the following input values:
c = Generator Efficiency
d = Heat Pump Efficiency
H = Heat Needed
W = Electricity Needed
Now, we know:
W = bc
H = ad + b(1-c)
Hence we can derive:
b = W/e
a = (H-W(1-c)/c)/d
Input your values for c,d,H and W and you get your result.

Related

How to get skewness and kurtosis using Julia

I'm working on pointcloud lidar data. I want to calculate skewness and kurtosis to distinguish road from ground. My current intensity column looks like this in plot Is there an implementation on another language? I read
First, the skewness of the point cloud is calculated. If it is
greater than zero, peaks dominate the point cloud distribution as
shown in Table 1. Thus, the highest value of the point cloud is re-
moved by classifying it as an object point. To separate all ground
and object points, these steps are iteratively executed while the
skewness of the point cloud is greater than zero.
UPDATE
I tried
the following code but its an infinite loop
I'm getting StatsBase.skewness(poi.intensity) around 0.125
data = rand(Gamma(7.5, 1.0), 75)
th=maximum(data)
classification=rand(2:3,length(data))
poi=Table(intensity=data,classification=classification)
while sk > 0
poi.classification[findall(poi.intensity .== th)] .= 7 #object
th = th .- 1
sk = skewness(poi.intensity[findall(poi.classification .== 2)])
print(sk)
end

Calculating contrast values on Excel

I am currently studying experimental designs in statistics and I am calculating values pertaining to 2^3 factorial designs.
The question that I have is particularly with the calculations of the "contrasts".
My goal of this question is to learn how to use the table "Coded Factors" and "Total" in order to get the values "Contrast" using the IF THEN function in Excel.
For example, Contrast A is calculated as : x - y . Where
x = sum of the values in the Total, where the Coded Factor A is + .
And y= sum of the values in the Total, where the Coded Factor A is - .
This would be rather simple, but for the interactions it is a bit more complex.
For example, contrast AC is obtained as : x - y . Where
x = sum of the values in the Total, where the product of Coded Factor A and that of C becomes + .
And y = sum of the values in the Total, where the product of Coded Factor A and that of B becomes - .
I would really appreciate your help.
Edited:
Considering the way how IF statements work, I thought that it might be a good idea to convert the + into 1 and - into -1 to make the calculation straight forward.
Convert all +/- to 1/-1. Use some cells as helper..
Put in these formulas :
J2 --> =LEFT(J1)
K2 --> =MID(J1,2,1)
L2 --> =MID(J1,3,1)
Put
J3 --> =IF(J$2="",1,INDEX($B3:$D3,MATCH(J$2,$B$2:$D$2,0)))
and drag to L10. Then
M3 --> =J3*K3*L3*G3
and drag to M10. Lastly,
M1 --> =SUM(M3:M10)
How to use : Input the Factor comb in cell J1 and the result will be in M1.
Idea : separate the factor text > load the multiplier > multiply Total values with multiplier > get sum.
Hope it helps.

Excel Formula, To Calcuate a maximum Weight based off a desired minimum profit (GP%)

So I am working on a spreadsheet for a Butchery I manage and have run into a problem.
First off back story: We do $20 packs for certain bulk products that have a min/max weight range.
The Goal is to be able to put in this spreadsheet the desired minimum GP% and from that get a maximum weight based off that minimum profit margin.
For example a Beef Steak that Costs $17.50 p/kilo Would be minimum of 680g (at a GP% of 30.30%) and a maximum weight of 790g (at a GP% of 20.50%)
I have been 'googling' all day, and banging my head on my desk (as well as experimenting with different formula's) I am starting to think I may have to resort to programming a macro to perform this but I would prefer to be able to achieve in a formula on the cell that way I can copy-paste easily down the spreadsheet.
If anyone has a solution or can put me on the right track would be Awesome.
I think the formula you are looking for is :
your selling price (=20$) / your mark up on cost
where your mark up is :
your cost per kilo / (1- your margin)
So for 20% expected GP it gives :
= 20 / (17.5 / (1-0.2))
= 20 / 21.875
= 0.914... kilos
Balance is then :
Revenue = 20$
Cost = 0.914 * 17.5 = 16
Margin = 4
Margin % = 20

Creating a Variable Curve from Linear Data

My end goal is to distribute items into different discounts for sales. For example I may have 1000 items in an up-to 20% off sale. I am trying to come up with a way to cluster more items towards a discount, say 15%. So the discount distribution is a curve, with the peak number of items around 15% and less items at the extreme low and high discounts.
I want this to work for many different sales- number of items included will change and the discount ranges will change. I may have 25,000 items in a 10-40% off sale.
Variables:
L = Low Discount
H = High Discount
S = Discount Spread (H - L)
I = Item Count
D = Discount Sread (S / I)
C = ClusterPeak, where I want the most items
All items are ranked and sorted. Using Excel, Excel VBA or FileMaker I am sure there is math thing I can throw at this to make work.
Using the first example of 1000 items in an up-to 20% off sale. (starting at 1%)
L = .01
H = .2
S = .19
I = 1000
D = .00019
C = .15
R = Current Row or Record.
To get linear, evenly distributed discounts, I know I can do this-
(R * S) + L or (1 * .00019) + .1
This gets me .01019, .01038... The 1000th item gets .2, or 20%. This works regardless of the discounts and items count. Yay!
But I am stumped on how to cluster more items around a discount in a smooth curve. I have tried throwing LOG and standard deviation at the problem in various uses but obivously it didn't work or I wouldn't be here.
Sorry if this is miscategorized or poorly explained. It is very hard explaning what you don't know. Is there a better name or description for what I am trying to accomplish?

understanding of result of logistic regression

let us suppose we have following data with binary response output(coupon)
annual spending is given in 1000th unit, my goal is to estimate whether if customer spend more then 2000 and has Simmons card, will also have coupon, first of all i have sorted data according to response data, i got following picture
at next stage i have calculated logit for each data, for those initially i choose following coefficient
B0 0.1
B1 0.1
B2 0.1
and i have calculated L according to the following formula
at next stage i have calculated e^L (which in excel can be done easily by exp function )
=EXP(D2)
after that i have calculated probability
=E2/(1+E2)
and finally using formula
i have calculated log likelihood function
then i have calculated sum and using solver i have calculated coefficient that minimize this sum( please pay attention that values are given in negative value) , but i have got all coefficient zero
i am wrong ? or does it means that i can'predict buying of coupon on the base of Annual spending and owning of Simmons card? thanks in advance
You can predict the buying of a coupon on the base of Annual spending (and knowing Simmons card doesn't help).
Admittedly I didn't solve it in Excel, but I suspect the problem might be that your optimization didn't converge (i.e., failed to reach the correct coefficients through the solving process) -- the correct coefficients are B0 = 5.63, B1 = -2.95, and B2 = 0. I found an online reference for the Excel logistic regression procedure at http://blog.excelmasterseries.com/2014/06/logistic-regression-performed-in-excel.html.
I ran the logistic regression myself and found that Annual spending is significant (at the 0.05 level) whereas Simmons card is not. Re-running the model with Simmons card removed yields the following equations:
L = 5.63 - 2.95 * Annual spending
P(1) = exp(L)/(1 + exp(L))
If P(1) > 0.5 => coupon = 1
Although the entropy Rsquare is low at 0.39 (and the number of data points is very low), the model is statistically significant.

Resources