Determine Sample Size from Power for Two Sample Proportions

Hello Everyone!

I just changed to a more clinical-trials related biostatistics job and my boss, who has a clinical background, made a power calculator in excel many years ago which he has forgotten the formula too. I wanted to re-create the formula from the excel sheet and then find a formula that matches so that we have it on file for when we compare our results with drug companies.

Attached is the formula from the excel sheet. And here is the key:
Z_∝=Z-score of Type I Error α
Z_(1-β)=Z-score of based on desired power
p_1=Control group proportion
p_2=Experimental group proportion
R= ratio between the sample sizes of the two groups

I have found a few formula that are somewhat similar, but none that include the (R+1) or some variation of the sample size ratio or the addition of P2(1-p2) after the second square root.

Any suggestions on where to look or what the formula might be?