Seems I found the solution.
Let n be the number of trials, π₀ be the reference probability. (I denote it with π to avoid confusing with p-value that will be mentioned later.) Let p₀ be the threshold probability from my original post. Then a dynamic array of all values for which the distribution is no greater than p₀ can be generated by the formula
= FILTER(SEQUENCE(n + 1, 1, 0), BINOM.DIST(SEQUENCE(n + 1, 1, 0), n, π₀, FALSE) <= p₀)
This works with Excel versions that support dynamic arrays and corresponding functions like FILTER and SEQUENCE.
But finding these values was not an end in itself for me; this was in fact needed to calculate an exact binomial p-value for two-sided proportion test: k is the observed number of successes, π = k/n is the sample proportion, and the hypotheses are:
So the p-value for this test can be calculated by the formula shown at this screenshot, and the corresponding Excel file is also attached.
binomial_p-value.png
Bookmarks