This question is related to automating a formula for dynamic range using Macro in excel.
I have 2 columns "A" and "B".
Column A with Application IDs. Application ID in column "A" change dynamically after some iterations i.e. have 18 count, then 43, then 15 and so on...
- Column B has corresponding 0s and 1s.
I'm calculating a binomial distribution formula based on the count values using 18 B values, then 43 B values, then 15 B values and so on.
If the Application ID in two rows doesn't match then a formula should be calculated. The formula contains 2-19 row values, than 20-62 row values, than 63-77 row values and so on...
I want it to calculate for 109972 cells. Looking for a macro which can do this.
First formula:
=IF(A19<>A20,BINOM.DIST(COUNTIF($B$2:B19,0),COUNT($B$2:B19),COUNTIF($B$2:B19,0)/COUNT($B$2:B19),FALSE),"")
Second Formula:
=IF(A62<>A63,BINOM.DIST(COUNTIF($B$20:B62,0),COUNT($B$20:B62),COUNTIF($B$20:B62,0)/COUNT($B$20:B62),FALSE),"")
Third Formula (and so on has to calculated)
=IF(A77<>A78,BINOM.DIST(COUNTIF($B$63:B77,0),COUNT($B$63:B77),COUNTIF($B$63:B77,0)/COUNT($B$63:B77),FALSE),"")
=IF(A2<>A3,BINOM.DIST(COUNTIF(OFFSET($B$2:B2,IFERROR(MATCH(0,$D1:D$2,-1),0),0,ROW()-IFERROR(MATCH(0,$D1:D$2,-1),0)-1),0),COUNT(OFFSET($B$2:B2,IFERROR(MATCH(0,$D1:D$2,-1),0),0,ROW()-IFERROR(MATCH(0,$D1:D$2,-1),0)-1)),COUNTIF(OFFSET($B$2:B2,IFERROR(MATCH(0,$D1:D$2,-1),0),0,ROW()-IFERROR(MATCH(0,$D1:D$2,-1),0)-1),0)/COUNT(OFFSET($B$2:B2,IFERROR(MATCH(0,$D1:D$2,-1),0),0,ROW()-IFERROR(MATCH(0,$D1:D$2,-1),0)-1)),FALSE),"-")
or you write yourself a VBA script. – Pᴇʜ