Reverse percentage formula [closed] - google-sheets

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
Apparently "reverse percentage calculations" are a confusing topic (I looked through existing questions) - but I'm not sure I understand it myself.
I have a counter in my Google Sheets that is counting down a certain number of cells, and then I have the total range of cells.
So for example: my counter is at 6000 and its counting down through a range of 7000 cells.
What I'm trying to do is calculate the percentage that it's done counting down.
When I divide the part by the total, I obviously get something like 90% - which is not what I want. It should be like 2% (or whatever) :P
Does anyone know the formula I should apply here?

try:
=1-COUNTA(A:A)/A1
(cell formatted as a percentage)

I think I solved it.
If A is counting down from 100 and 0 = 100%, then the information I was originally missing was the difference between 100 and A.
So in my case:
A3:
=ROWS(A1:A)-A2
(A1:A is 100%)
(A2 is the current countdown)
So for example if ROWS(A1:A) = 10 (total rows in your sheet) & if my current countdown is 3 then:
A3:
=ROWS(A1:A)-A2 = 7
Then we calculate the percentage by:
A4:
=A3/ROWS(A1:A)
That should give you the correct percentage.

Related

How to make a sequence in google sheets which has increments in regular intervals

I want to create a sequence in google sheets where i have to make a sequence of this sort like if the sequence starts at 5000, it should be 5000 for the next 12 rows and then it should increment to 5500 and then it should go on for another 12 rows to be 5500. So basically it should increment by 10% after 12 rows and continue to do this.
=ArrayFormula(vlookup(quotient(sequence(Blocklength*Blocks,1,0),Blocklength),
{sequence(Blocks,1,0),Start*(1+Increment)^(sequence(Blocks,1,0))},2))
Comment
You don't actually need the vlookup, could go straight to the calculation, but with a power calculation in every row this might be slower:
=ArrayFormula(Start*(1+Increment)^quotient(sequence(Blocklength*Blocks,1,0),Blocklength))
I found this a bit tricky, maybe others have smoother answers. But one way is to use FV() function for a compound interest. With a combination of SEQUENCE() you can get the cumulative increase:
Formula in A1:
=INDEX(FLATTEN(SPLIT(REPT(FV(D3,SEQUENCE(D4),0,-(D1/(D3+1)))&"|",D2),"|",1)))
Or, without the FV() function, but with math and same concept:
=INDEX(FLATTEN(SPLIT(REPT(D1*(1+D3)^SEQUENCE(D4,1,0)&"|",D2),"|",1)))
Note: For reading purposes I set blocksize to 2 rows only.
Try, with B1=5000, B2=10%, B3=24 periods (288 values=24*12)
=arrayformula(sort(flatten(sequence(12,1,B1,0)*(1+B2)^(sequence(1,B3,0,1)))))

Is there a better Google Sheets rounding/floating point error workaround? [duplicate]

This question already has an answer here:
Google Sheet yields infinitesimal number as remainder of an integer/whole number
(1 answer)
Closed 3 months ago.
I have a Sheet that gives me a rounding error:
Rounding 0.415 to 2 places should result in 0.42, which it does when given the number directly. But the red line gives 0.41. The intermediate result before rounding is slightly less than 0.415, as shown in the second line.
The green line shows a workaround, which I guess I'll have to use throughout, unless anyone can suggest a better one. Any offers?
try:
=ROUNDUP((170.625-168.55)*0.2, 2)

Needing formula for a compounding number multiplied by a value (Not anually)

Looking for very simple compounding math.
I have a number, for example, 5000. This number increases by a percent, for simplicity sake, let's say it increases by 100%, it does that 3 times. The final result for that should be 40000. 5000*2 then *2 then *2.
The question is, how do I make this happen with math on a spreadsheet. Preferably Google Sheets. Something I can use variables in for the percentages and times it increases.
This is not for annual compounding interest or any of that. I just need plain and simple compounding numbers.
Most likely you seek something simple as:
=A22*2^3
which could be also written as:
=A22*2*2*2
in terms of percentage it would be simply:
=(A22*B22)*2^3

calculate possible combinations between multiple arrays

I'm making a question list. There are 3 questions, each with 4 answers. I'm trying to calculate which combinations are possible.
There should be 4x4x4 (=64) possible combinations. And I expect an array like this [1,1,1] (user answers all 3 questions with the first answer).
I see that ruby has a nice permatation method, but it's not permatiation. The combination method, only takes 1 array to an account.
So in short, I have 3 array, each with [1,2,3,4] and I like 64 arrays with every combination
Use Array#product method.
[1,2,3,4].product([1,2,3,4],[1,2,3,4]).size # => 64
I used Array#size to show you, that 64 combinations are being generated.
If the number of answers to all questions is the same you can calculate the number of possible combinations by using number of answers raised to the number of questions. The ruby code for that would be:
answer_count = 4
question_count = 3
combinations = answer_count**question_count
If the number of answers to each question is different you can count them and then multiply them for your answer (as you were on the road to doing in your question). For example if you have 3 questions and the first has 4 answers, the second has 5 answers and the third has 3 answers you could do something like this:
answer_counts = [4, 5, 3]
answer_counts.inject(1) {|product, answers| product * answers}

About the inference result of Blei's lda-c-dist [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a question about the inference result of lda-c-dist package. How many words should be displayed when viewing results of inference? For example, if I set number of words to a very large number N(assume number of all terms are N), it seems to exist some groups of words. In each group, the index of words are ranging from 1 to N.
What I got is like,
Assume number of terms is 10, and I assign the number of words displayed to 10.
Topic 0xx:
001
008
009
002
003
007
000
004
005
006
It seems that, may be I should set words displayed 3, not 10.
So, as to one topic, when viewing topics by calling topics.py, how many words should be specified?
Besides, I'm going to use this output to calculate the similarity of two topics. So ...
Actually, there can be as many items as the vocabularies are. What is displayed here, is just a probability descending order for a limited number indicated.

Resources