I'm trying to create a Power Analysis macro that I use as an add-in in excel. I've previously done this successfully for a significance testing macro, but this one seems to be giving me issues. the prompt asks for 2 proportions, a kappa, an alpha, power and sample size. The point of the macro is to estimate one of the last 2. In different instances the power is known and sample size is unknown, there are also instances where sample size is known and power is unknown. Whichever is unknown is what's being estimated. Any advice would be appreciated. I've attached what I currently have.