From 368f9a1263386b30cdae9cc26072274ba4b2abaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 6 Sep 2016 15:02:17 +0800 Subject: [PATCH] Changed the total proporation to the sum of each proportaion instead of dividing itself. --- _5Chi2GoF.vb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/_5Chi2GoF.vb b/_5Chi2GoF.vb index 864cf2a..a4cc19a 100644 --- a/_5Chi2GoF.vb +++ b/_5Chi2GoF.vb @@ -224,6 +224,7 @@ Sub subReportChi2GoodnessOfFit (oDoc As Object, oDataRange As Object) sFormula = "=" & mCellNI (nI) & "/" & sCellN oCell.setFormula (sFormula) oCell.setPropertyValue ("NumberFormat", nFormatPct) + mCellPI (nI) = fnGetLocalRangeName (oCell) Next nI ' Shows the total nRow = nRow + 2 @@ -239,7 +240,11 @@ Sub subReportChi2GoodnessOfFit (oDoc As Object, oDataRange As Object) Next nJ oCell = oSheet.getCellByPosition (1 + nGroups, nRow) sCells = fnGetLocalRangeName (oSheet.getCellRangeByPosition (1, nRow, nGroups, nRow)) - sFormula = "=" & sCellN & "/" & sCellN + sFormula = "" + For nI = 0 To nEvents - 1 + sFormula = sFormula & "+" & mCellPI (nI) + Next nI + sFormula = "=" & Right (sFormula, Len (sFormula) - 1) oCell.setFormula (sFormula) oCell.setPropertyValue ("NumberFormat", nFormatPct)