Looking for a udf to calculate numerator

michaelsmith559

Well-known Member
Joined
Oct 6, 2013
Messages
842
I have a sheet setup to calculate a naive bayes estimate. I am looking for a udf that can calculate the numerator for me as I have a lot of values to check and this part is manually too time consuming. The udf needs to ignore cells that contain a zero. What I want to be able to do is in cell BL18 and cell BM19 enter something like =numerator(select my range of cells) and then get an output like the current formulas give me. See sheet below:

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>BE</th><th>BF</th><th>BG</th><th>BH</th><th>BI</th><th>BJ</th><th>BK</th><th>BL</th><th>BM</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: center;;">Num Group</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Value</td><td style="text-align: center;;">5</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;">Value</td><td style="text-align: center;;">5</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Num Group</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">118</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0.152542</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Low High</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">296</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.060811</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Odd Even</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">% Match</td><td style="text-align: center;;">0.986</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;;">Low High Range</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Diff</td><td style="text-align: center;;">0.02</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Decimal</td><td style="text-align: center;;">-0.000003</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;;">Success Low</td><td style="text-align: center;;">277</td><td style="text-align: center;;">Success Low</td><td style="text-align: center;;">0</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Prob of Number</td><td style="text-align: center;;">0.043478261</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: center;;">Success High</td><td style="text-align: center;;">137</td><td style="text-align: center;;">Success High</td><td style="text-align: center;;">0.131387</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">Success</td><td style="text-align: center;;">Failure</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style="text-align: center;;">Odd Even Range</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0.152542373</td><td style="text-align: center;;">0.060810811</td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0</td><td style="text-align: center;;">0.131386861</td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style="text-align: center;;">Success Odd</td><td style="text-align: center;;">215</td><td style="text-align: center;;">Success Low</td><td style="text-align: center;;">0.083721</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0.08372093</td><td style="text-align: center;;">0</td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style="text-align: center;;">Success Even</td><td style="text-align: center;;">199</td><td style="text-align: center;;">Success High</td><td style="text-align: center;;">0</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0</td><td style="text-align: center;;">0.044226044</td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0</td><td style="text-align: center;;">0.049586777</td></tr><tr ><td style="color: #161120;text-align: center;">16</td><td style="text-align: center;;">Percent Match</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0.038834951</td><td style="text-align: center;;">0.048387097</td></tr><tr ><td style="color: #161120;text-align: center;">17</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0.043478261</td><td style="text-align: center;;">0.956521739</td></tr><tr ><td style="color: #161120;text-align: center;">18</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">7</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Numerator</td><td style="text-align: center;;">3.46098E-08</td><td style="text-align: right;;">1.19034E-07</td></tr><tr ><td style="color: #161120;text-align: center;">19</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">407</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.044226</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">20</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Naïve Bayes Estimate</td><td style="text-align: center;;">0.225260262</td><td style="text-align: center;;">0.774739738</td></tr><tr ><td style="color: #161120;text-align: center;">21</td><td style="text-align: center;;">Difference Value</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">22</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">413</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">23</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">50</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">24</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">363</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.049587</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">25</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">26</td><td style="text-align: center;;">Decimal Number</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">27</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">413</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">28</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">103</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0.038835</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">29</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">310</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.048387</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">30</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">31</td><td style="text-align: center;;">Probability of Number</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">32</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">33</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">18</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0.043478</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">34</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">396</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.956522</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL11</th><td style="text-align:left">=BH3</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM11</th><td style="text-align:left">=BH4</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL12</th><td style="text-align:left">=BH8</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM12</th><td style="text-align:left">=BH9</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL13</th><td style="text-align:left">=BH13</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM13</th><td style="text-align:left">=BH14</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL14</th><td style="text-align:left">=BH18</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM14</th><td style="text-align:left">=BH19</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL15</th><td style="text-align:left">=BH23</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM15</th><td style="text-align:left">=BH24</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL16</th><td style="text-align:left">=BH28</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM16</th><td style="text-align:left">=BH29</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL17</th><td style="text-align:left">=BH33</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM17</th><td style="text-align:left">=BH34</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL18</th><td style="text-align:left">=(<font color="Blue">PRODUCT(<font color="Red">BL11:BL11</font>)*BF3/BF2</font>)*(<font color="Blue">PRODUCT(<font color="Red">BL13:BL13</font>)*BF13/BF12</font>)*(<font color="Blue">PRODUCT(<font color="Red">BL16:BL16</font>)*BF28/BF27</font>)*(<font color="Blue">PRODUCT(<font color="Red">BL17:BL17</font>)*BF33/BF32</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM18</th><td style="text-align:left">=(<font color="Blue">PRODUCT(<font color="Red">BM11:BM11</font>)*BF4/BF2</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM12:BM12</font>)*BF9/BF7</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM14:BM14</font>)*BF19/BF17</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM15:BM15</font>)*BF24/BF22</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM16:BM16</font>)*BF29/BF27</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM17:BM17</font>)*BF34/BF32</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL20</th><td style="text-align:left">=BL18/SUM(<font color="Blue">BL18:BM18</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM20</th><td style="text-align:left">=BM18/SUM(<font color="Blue">BL18:BM18</font>)</td></tr></tbody></table></td></tr></table><br />
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,752
Hi

You don't need a udf, you can use a formula.
Test the values in BL11:BL17 and discard the products where they are 0, like in B18:

=PRODUCT(IF(BL11:BL17,BL11:BL17^{1,0}*N(OFFSET(BF2,(ROW(B11:B17)-ROW(B11))*5+{0,1},))^{-1,1}))

This is an array formula, you have to confirm it with CTRL-SHIFT-ENTER
 

michaelsmith559

Well-known Member
Joined
Oct 6, 2013
Messages
842
The formula works for the values shown in BM1:BM8. When I change the values, to the next value to evaluate, the value returned using the formula in BL18 returns: 3.18385E-08 and your formula returns: 2.49388E-09.

<colgroup><col width="107"></colgroup><tbody>
</tbody>
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,752
The formula works for the values shown in BM1:BM8. When I change the values, to the next value to evaluate, the value returned using the formula in BL18 returns: 3.18385E-08 and your formula returns: 2.49388E-09.

Sorry, I don't understand: "When I change the values, to the next value to evaluate"

You mean you have new values in BL11:BL17? which are they?
 

michaelsmith559

Well-known Member
Joined
Oct 6, 2013
Messages
842
Also, it looks like when I put the formula into BL19, it works for calculating the numerator for BL18. When I move the formula to BM19 and calculate BM18, it gives different results.
 

michaelsmith559

Well-known Member
Joined
Oct 6, 2013
Messages
842
<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>BE</th><th>BF</th><th>BG</th><th>BH</th><th>BI</th><th>BJ</th><th>BK</th><th>BL</th><th>BM</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: center;;">Num Group</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Value</td><td style="text-align: center;;">5</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;">Value</td><td style="text-align: center;;">5</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Num Group</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">118</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0.152542</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Low High</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">296</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.060811</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Odd Even</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">% Match</td><td style="text-align: center;;">0.986</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;;">Low High Range</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Diff</td><td style="text-align: center;;">0.02</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Decimal</td><td style="text-align: center;;">-0.000003</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;;">Success Low</td><td style="text-align: center;;">277</td><td style="text-align: center;;">Success Low</td><td style="text-align: center;;">0</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Prob of Number</td><td style="text-align: center;;">0.043478261</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: center;;">Success High</td><td style="text-align: center;;">137</td><td style="text-align: center;;">Success High</td><td style="text-align: center;;">0.131387</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">Success</td><td style="text-align: center;;">Failure</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style="text-align: center;;">Odd Even Range</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0.152542373</td><td style="text-align: center;;">0.060810811</td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0</td><td style="text-align: center;;">0.131386861</td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style="text-align: center;;">Success Odd</td><td style="text-align: center;;">215</td><td style="text-align: center;;">Success Low</td><td style="text-align: center;;">0.083721</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0.08372093</td><td style="text-align: center;;">0</td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style="text-align: center;;">Success Even</td><td style="text-align: center;;">199</td><td style="text-align: center;;">Success High</td><td style="text-align: center;;">0</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0</td><td style="text-align: center;;">0.044226044</td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0</td><td style="text-align: center;;">0.049586777</td></tr><tr ><td style="color: #161120;text-align: center;">16</td><td style="text-align: center;;">Percent Match</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0.038834951</td><td style="text-align: center;;">0.048387097</td></tr><tr ><td style="color: #161120;text-align: center;">17</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">0.043478261</td><td style="text-align: center;;">0.956521739</td></tr><tr ><td style="color: #161120;text-align: center;">18</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">7</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Numerator</td><td style="text-align: center;;">3.46098E-08</td><td style="text-align: right;;">1.19034E-07</td></tr><tr ><td style="color: #161120;text-align: center;">19</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">407</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.044226</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">3.46098E-08</td><td style="text-align: center;;">3.43273E-12</td></tr><tr ><td style="color: #161120;text-align: center;">20</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">Naïve Bayes Estimate</td><td style="text-align: center;;">0.225260262</td><td style="text-align: center;;">0.774739738</td></tr><tr ><td style="color: #161120;text-align: center;">21</td><td style="text-align: center;;">Difference Value</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">22</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">413</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">23</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">50</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">24</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">363</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.049587</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">25</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">26</td><td style="text-align: center;;">Decimal Number</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">27</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">413</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">28</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">103</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0.038835</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">29</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">310</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.048387</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">30</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">31</td><td style="text-align: center;;">Probability of Number</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">32</td><td style="text-align: center;;">Total</td><td style="text-align: center;;">414</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">33</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">18</td><td style="text-align: center;;">Success</td><td style="text-align: center;;">0.043478</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">34</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">396</td><td style="text-align: center;;">Failure</td><td style="text-align: center;;">0.956522</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL11</th><td style="text-align:left">=BH3</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM11</th><td style="text-align:left">=BH4</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL12</th><td style="text-align:left">=BH8</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM12</th><td style="text-align:left">=BH9</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL13</th><td style="text-align:left">=BH13</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM13</th><td style="text-align:left">=BH14</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL14</th><td style="text-align:left">=BH18</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM14</th><td style="text-align:left">=BH19</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL15</th><td style="text-align:left">=BH23</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM15</th><td style="text-align:left">=BH24</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL16</th><td style="text-align:left">=BH28</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM16</th><td style="text-align:left">=BH29</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL17</th><td style="text-align:left">=BH33</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM17</th><td style="text-align:left">=BH34</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL18</th><td style="text-align:left">=(<font color="Blue">PRODUCT(<font color="Red">BL11:BL11</font>)*BF3/BF2</font>)*(<font color="Blue">PRODUCT(<font color="Red">BL13:BL13</font>)*BF13/BF12</font>)*(<font color="Blue">PRODUCT(<font color="Red">BL16:BL16</font>)*BF28/BF27</font>)*(<font color="Blue">PRODUCT(<font color="Red">BL17:BL17</font>)*BF33/BF32</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM18</th><td style="text-align:left">=(<font color="Blue">PRODUCT(<font color="Red">BM11:BM11</font>)*BF4/BF2</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM12:BM12</font>)*BF9/BF7</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM14:BM14</font>)*BF19/BF17</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM15:BM15</font>)*BF24/BF22</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM16:BM16</font>)*BF29/BF27</font>)*(<font color="Blue">PRODUCT(<font color="Red">BM17:BM17</font>)*BF34/BF32</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL20</th><td style="text-align:left">=BL18/SUM(<font color="Blue">BL18:BM18</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM20</th><td style="text-align:left">=BM18/SUM(<font color="Blue">BL18:BM18</font>)</td></tr></tbody></table></td></tr></table><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BL19</th><td style="text-align:left">{=PRODUCT(<font color="Blue">IF(<font color="Red">BL11:BL17,BL11:BL17^{1,0}*N(<font color="Green">OFFSET(<font color="Purple">BF2,(<font color="Teal">ROW(<font color="#FF00FF">B11:B17</font>)-ROW(<font color="#FF00FF">B11</font>)</font>)*5+{0,1},</font>)</font>)^{-1,1}</font>)</font>)}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">BM19</th><td style="text-align:left">{=PRODUCT(<font color="Blue">IF(<font color="Red">BM11:BM17,BM11:BM17^{1,0}*N(<font color="Green">OFFSET(<font color="Purple">BF2,(<font color="Teal">ROW(<font color="#FF00FF">B11:B17</font>)-ROW(<font color="#FF00FF">B11</font>)</font>)*5+{0,1},</font>)</font>)^{-1,1}</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,752
I see.

Well, the formulas you are using in BL18 and BM18 are not doing the same thing.

In BL18 you choose in each group of 3 values in column BF the second and the first values and you divide them and multiply the result by the corresponding value in column BL.
In BM18 you choose in each group of 3 values in column BF the third and the first values and you divide them and multiply the result by the corresponding value in column BM.

This means that in the formula in BM you have to use an offset of 2 instead of 1

{=PRODUCT(IF(BM11:BM17,BM11:BM17^{1,0}*N(OFFSET(BF2,(ROW(B11:B17)-ROW(B11))*5+{0,2},))^{-1,1}))}

{
 

Forum statistics

Threads
1,082,323
Messages
5,364,584
Members
400,809
Latest member
formulasataglance

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top