Reversing Order Scale - Math formulae help needed - google-sheets

Can anyone help with a formula / equation to help with my problem?
I'm trying to do (reverse) the following..........
I know the Base Price to be 250
The no. of orders are 8
Each order increases at scale of 1.5
=250*(1.5^7) = 4271.48 total
Im trying (and failing) to come up with a formula to reverse the above equation to provide me with the the Base Price (assuming I now know the total, in addition to the no of orders and the scale)
i.e what formula would I use to get the Base Price, assuming I know know the total is 4271.48 (based on the same 8 orders and scale of 1.5)
I've attached a quick spreadsheet to help describe my problem!
https://docs.google.com/spreadsheets/d/1hzHwvYbXWH8Pkpvf8K7GVyAFcgLWeRuTUcN9A1S52Hg/edit?usp=sharing
Thank you in advance :-)

Try this one. Use - in power.
=B17*(1.5^-7)

Related

Do I need to do a Bonferonni correction on a 2x2 chi square analysis?

I'm really hoping someone here can help.
I have performed a chi-square test of independence, looking at men/women and early/late drop out from therapy. I have a p-value of 0.047. Do I need to do any post hoc testing on this? Men drop out almost 50:50 early:late whereas women drop out almost 25:75 early:late. Do I need post hoc testing for this and a Bonferonni correction, or is the answer simply:
The frequency of retention rates was compared across gender, finding a significant interaction (X2 (1) = 3.94, p = 0.047), indicating that females were more likely to be retained past the third CBT session than men.
Any help would be greatly appreciated, stats hurt my head and I can't continue past this problem.
Since there's only one test performed, with a single degree of freedom, there's no way (or need) to do any multiple comparison correction.

Google Sheets IF AND OR Logic

I am making a scoring system on Google sheets and I am struggling with the logic I need for the final step.
This question might be related, but I can't seem to apply the logic.
There are a number of chemicals tested and for each an amount detected (AD) si given, and each has a benchmark amount allowed (AL). From AL and AD we calculate AD/AL= %AL.
The Total Score (TS) is calculated based on an additive and weighted formula that takes into consideration the individual %ALs, but I won't go into that formula.
The final step is for me to "calculate" the Display Score (DS), which has some rules to it, and this is where I need the logic. The rules are as follows:
If any of the %Als are over 100 (this is will make TS>100 too) and DS should show "100+"
If none of the %ALs are over 99, (TS may be above or below 100) then DS can NOT be over 99, so it should show TS, maxing out at 99.
I want to do this within the sheet itself. I think the correct tool is logic operators IF, AND, OR.
I have made many attempts, these are some: (I am replacing cell references with the acronyms I used above)
=IF(TS>100,"100+",TS)
=IF(OR(AND(MAX(RANGE_OF_%ALS)<100,TS>99),(AND(MAX(RANGE_OF_%ALS)>100,TS>100)),99,"100+"))
I have also tried to think about how I would solve this in Python (just to explore it, I don't want to use Python for the solution). This was my attempt:
if Max%AL<100:
if TS<100:
print(TS)
else:
print("99")
else:
if TS>100:
print("100+")
Those are my attempts at thinking through the problem. I would appreciate some help.
This is a link to a copy of my sheet: https://docs.google.com/spreadsheets/d/1ZBnaFUepVdduEE2GBdxf5iEsfDsFNPIYhrhblHDHEYs/edit?usp=sharing
Please try:
=if(max(RANGE_OF_%ALS)>1,"100+",if(max(RANGE_OF_%ALS)<=0.99,MIN(TS,0.99),"?"))

Nested iif statement to round to nickels! Will it work? AKA Penny Rounding

I have searched the web over, and have found very little dealing with this. I wanted to know if there are any deeper issues that I am unware of getting the results this way. the [total] variable represents the calculated total owing. PayAmt represents what the customer will pay when paying cash only.
PayAmt: FormatCurrency(
IIf(Right(Str(Round([total],2)),1)="1",[total]-1,
IIf(Right(Str([total]),1)="2",[total]-2,
IIf(Right(Str([total]),1)="3",[total]+2,
IIf(Right(Str([total]),1)="4",[total]+1,
IIf(Right(Str([total]),1)="6",[total]-1,
IIf(Right(Str([total]),1)="7",[total]-2,
IIf(Right(Str([total]),1)="8",[total]+2,
IIf(Right(Str([total]),1)="9",[total]+1,[total])))))))))/100
This does on its face give the results as expected, I am just not sure IF I should approach this issue this way?
0.98 - 1.02 = 1.00
1.03 - 1.07 = 1.05
Having not seen anything like this, I suspect it can't be this easy. I just don't know why.
Thanks for any help!
Never use string handling for numbers.
Here is an article about serious rounding including all necessary code for any value and data type of VBA:
Rounding values up, down, by 4/5, or to significant figures

Formula to see if you're on track of monthly budget

I'm not sure where to post this question but I thought here would be a good spot. What would be a Google Sheets formula to see if I am on track to stay within my allocated monthly allowance? I'm not very good at math and I've tried to come up with a solution but I'm not sure how & I've looked it up and done research but I still am not sure of the right formula to use. I've tried using something like (actual - goal)/ABS(goal)+100% but that returns a small number and I'm sure that's not correct.
Any help would be greatly appreciated! thanks!
Not sure I understand your question, maybe some example numbers could help.
Let say you have:
goal = 1000
actual=150
Using your formula
actual - goal = -850
I think what you should do is to find (goal - actual) instead => 850
Then you can do your percentage of use:
(goal - actual) / goal * 100 => 85%
So on your sheet, if your goal is in the cell A1 and your actual in cell A2, type something like (this is excel-like I believe):
=($A$1 - $A$2) / $A$1 * 100
Hope it is helping.

objective-c looking for algorithm

In my application I need to determine what the plates a user can load on their barbell to achieve the desired weight.
For example, the user might specify they are using a 45LB bar and have 45,35,25,10,5,2.5 pound plates to use. For a weight like 115, this is an easy problem to solve as the result neatly matches a common plate. 115 - 45 / 2 = 35.
So the objective here is to find the largest to smallest plate(s) (from a selection) the user needs to achieve the weight.
My starter method looks like this...
-(void)imperialNonOlympic:(float)barbellWeight workingWeight:(float)workingWeight {
float realWeight = (workingWeight - barbellWeight);
float perSide = realWeight / 2;
.... // lots of inefficient mod and division ....
}
My thought process is to determine first what the weight per side would be. Total weight - weight of the barbell / 2. Then determine what the largest to smallest plate needed would be (and the number of each, e.g. 325 would be 45 * 3 + 5 or 45,45,45,5.
Messing around with fmodf and a couple of other ideas it occurred to me that there might be an algorithm that solves this problem. I was looking into BFS, and admit that it is above my head but still willing to give it a shot.
Appreciate any tips on where to look in algorithms or code examples.
Your problem is called Knapsack problem. You will find a lot solution for this problem. There are some variant of this problem. It is basically a Dynamic Programming (DP) problem.
One of the common approach is that, you start taking the largest weight (But less than your desired weight) and then take the largest of the remaining weight. It easy. I am adding some more links ( Link 1, Link 2, Link 3 ) so that it becomes clear. But some problems may be hard to understand, skip them and try to focus on basic knapsack problem. Good luck.. :)
Let me know if that helps.. :)

Resources