<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Standard Deviation of Counts</title>
	<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/</link>
	<description></description>
	<pubDate>Sun, 12 Oct 2008 08:25:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.1</generator>

	<item>
		<title>by: Ross</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-46478</link>
		<pubDate>Tue, 20 May 2008 11:24:18 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-46478</guid>
					<description>Hi Jelle-Jeroen, 
Thanks, thats fine no worries, 
Cheers
Ross</description>
		<content:encoded><![CDATA[<p>Hi Jelle-Jeroen,<br />
Thanks, thats fine no worries,<br />
Cheers<br />
Ross
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jelle-Jeroen</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-46466</link>
		<pubDate>Tue, 20 May 2008 08:43:02 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-46466</guid>
					<description>Ross,

I toke the liberty to post it, If you've got any problems with that I will remove it.

Jelle-Jeroen</description>
		<content:encoded><![CDATA[<p>Ross,</p>
<p>I toke the liberty to post it, If you&#8217;ve got any problems with that I will remove it.</p>
<p>Jelle-Jeroen
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jelle-Jeroen</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-46352</link>
		<pubDate>Mon, 19 May 2008 06:33:25 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-46352</guid>
					<description>Ross,

Do you mind if I write a topic on my own blog about this.....?

Jelle-Jeroen</description>
		<content:encoded><![CDATA[<p>Ross,</p>
<p>Do you mind if I write a topic on my own blog about this&#8230;..?</p>
<p>Jelle-Jeroen
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jelle-Jeroen</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-46299</link>
		<pubDate>Sun, 18 May 2008 13:53:12 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-46299</guid>
					<description>Ross,

After reading Rob's post I toke his way of thinking and wrote an array function for all the rows.
Its a little bit long but checked out correctly..... ( I think )

{=SQRT((SUM(counts)*SUM(MMULT(values^2,TRANSPOSE(counts)))-((SUM(MMULT(values,TRANSPOSE(counts))))^2))/(SUM(counts)*(SUM(counts)-1)))}</description>
		<content:encoded><![CDATA[<p>Ross,</p>
<p>After reading Rob&#8217;s post I toke his way of thinking and wrote an array function for all the rows.<br />
Its a little bit long but checked out correctly&#8230;.. ( I think )</p>
<p>{=SQRT((SUM(counts)*SUM(MMULT(values^2,TRANSPOSE(counts)))-((SUM(MMULT(values,TRANSPOSE(counts))))^2))/(SUM(counts)*(SUM(counts)-1)))}
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ross</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45920</link>
		<pubDate>Wed, 14 May 2008 11:46:45 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45920</guid>
					<description>Hi Rob, 
Thanks I'll take a look at that, it looks like it makes sense. I did try to use a SP, but i got a bit stuck with zeros!
Cheers
Ross</description>
		<content:encoded><![CDATA[<p>Hi Rob,<br />
Thanks I&#8217;ll take a look at that, it looks like it makes sense. I did try to use a SP, but i got a bit stuck with zeros!<br />
Cheers<br />
Ross
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Rob</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45853</link>
		<pubDate>Tue, 13 May 2008 17:43:18 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45853</guid>
					<description>a sumproduct and a bit of maths should do the trick (if i understand you correctly).

for the top line of results,:
=SQRT(SUMPRODUCT((values_range-mean)^2,count_range))/(n-1)) and entered as an array formula (ctrl-enter).

it wouldn't extend simply to a multirow version but you could just have an extra column of 'total deviations' and then add em up, divide by n-1 and sqrt.

Rob</description>
		<content:encoded><![CDATA[<p>a sumproduct and a bit of maths should do the trick (if i understand you correctly).</p>
<p>for the top line of results,:<br />
=SQRT(SUMPRODUCT((values_range-mean)^2,count_range))/(n-1)) and entered as an array formula (ctrl-enter).</p>
<p>it wouldn&#8217;t extend simply to a multirow version but you could just have an extra column of &#8216;total deviations&#8217; and then add em up, divide by n-1 and sqrt.</p>
<p>Rob
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ross</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45227</link>
		<pubDate>Wed, 07 May 2008 13:54:36 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45227</guid>
					<description>Hi Jelle-Jeroen, 
I recheck the function, you are right, it works correctly for some sets, but is incorrect for others! I'm not sure why, will have to look into it a bit more, 

re Doh:
its what Homer says when re realises hes made a mistake - like i did by looping, rather than just add up the totals in the range, - i did appreciate your remarks, thanks. 
http://www.arar93.dsl.pipex.com/mds975/Images/homer_simpson_doh_02.gif</description>
		<content:encoded><![CDATA[<p>Hi Jelle-Jeroen,<br />
I recheck the function, you are right, it works correctly for some sets, but is incorrect for others! I&#8217;m not sure why, will have to look into it a bit more, </p>
<p>re Doh:<br />
its what Homer says when re realises hes made a mistake - like i did by looping, rather than just add up the totals in the range, - i did appreciate your remarks, thanks.<br />
<a href='http://www.arar93.dsl.pipex.com/mds975/Images/homer_simpson_doh_02.gif' rel='nofollow'>http://www.arar93.dsl.pipex.com/mds975/Images/homer_simpson_doh_02.gif</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jelle-Jeroen</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45222</link>
		<pubDate>Wed, 07 May 2008 13:24:37 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45222</guid>
					<description>Ross,

What was your Standard deviation...?
Did you have 167 scores....?

I'm dutch and didn't understand your remark: Doh!!!!
Do you appreciate my remark or didn't you

Jelle-Jeroen</description>
		<content:encoded><![CDATA[<p>Ross,</p>
<p>What was your Standard deviation&#8230;?<br />
Did you have 167 scores&#8230;.?</p>
<p>I&#8217;m dutch and didn&#8217;t understand your remark: Doh!!!!<br />
Do you appreciate my remark or didn&#8217;t you</p>
<p>Jelle-Jeroen
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ross</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45198</link>
		<pubDate>Wed, 07 May 2008 10:32:09 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-45198</guid>
					<description>Hi  Jelle-Jeroen, 
 
[vba]
ReDim Scores(1 To WorksheetFunction.Sum(Counts))
[/vba]
Doh!!!!!

Mine semed to work for my data - i did check the results!!! maybe we have it set up diffrently?</description>
		<content:encoded><![CDATA[<p>Hi  Jelle-Jeroen, </p>
<div class="syntax_hilite">
<div id="vba-1">
<div class="vba"><span style="color: #0000DD;">ReDim</span> Scores<span style="color:#202020; ">&#40;</span><span style="color: #202020;">1</span> <span style="color: #0000DD;">To</span> WorksheetFunction.<span style="">Sum</span><span style="color:#202020; ">&#40;</span>Counts<span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span></div>
</div>
</div>
<p>
Doh!!!!!</p>
<p>Mine semed to work for my data - i did check the results!!! maybe we have it set up diffrently?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jelle-Jeroen</title>
		<link>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-44983</link>
		<pubDate>Mon, 05 May 2008 11:09:11 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2008/05/04/standard-deviation-of-counts/#comment-44983</guid>
					<description>Using your function I get a Standard Deviation equal to 1.4142135623731

But if you manually calculate the Standard Deviation of the 167 scores the answer is 1.01215468673352 ( asuming this is a partial sample of the whole population)

I ajusted your code

[VBA]
Function SDCOUNTS(Counts As Range, Values As Range)

    Dim Scores() As Double
    
    Dim i As Integer
    Dim j As Integer
    Dim k As Integer
    
    k = 1
    
    ReDim Scores(1 To WorksheetFunction.Sum(Counts))
    
    For i = 1 To Values.Cells.Count
        For j = 1 To WorksheetFunction.Sum(Counts.Columns(i))
            Scores(k) = Values.Cells(1, i).Value
            k = k + 1
        Next j
    Next i
    
    SDCOUNTS = WorksheetFunction.StDevP(Scores)

End Function
[/VBA]

Cheers</description>
		<content:encoded><![CDATA[<p>Using your function I get a Standard Deviation equal to 1.4142135623731</p>
<p>But if you manually calculate the Standard Deviation of the 167 scores the answer is 1.01215468673352 ( asuming this is a partial sample of the whole population)</p>
<p>I ajusted your code</p>
<div class="syntax_hilite">
<div id="vba-2">
<div class="vba"><span style="color: #0000DD;">Function</span> SDCOUNTS<span style="color:#202020; ">&#40;</span>Counts <span style="color: #0000DD;">As</span> Range, Values <span style="color: #0000DD;">As</span> Range<span style="color:#202020; ">&#41;</span></p>
<p>&nbsp; &nbsp; <span style="color: #0000DD;">Dim</span> Scores<span style="color:#202020; ">&#40;</span><span style="color:#202020; ">&#41;</span> <span style="color: #0000DD;">As</span> <span style="color: #0000DD;">Double</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000DD;">Dim</span> i <span style="color: #0000DD;">As</span> <span style="color: #0000DD;">Integer</span><br />
&nbsp; &nbsp; <span style="color: #0000DD;">Dim</span> j <span style="color: #0000DD;">As</span> <span style="color: #0000DD;">Integer</span><br />
&nbsp; &nbsp; <span style="color: #0000DD;">Dim</span> k <span style="color: #0000DD;">As</span> <span style="color: #0000DD;">Integer</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; k = <span style="color: #202020;">1</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000DD;">ReDim</span> Scores<span style="color:#202020; ">&#40;</span><span style="color: #202020;">1</span> <span style="color: #0000DD;">To</span> WorksheetFunction.<span style="">Sum</span><span style="color:#202020; ">&#40;</span>Counts<span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000DD;">For</span> i = <span style="color: #202020;">1</span> <span style="color: #0000DD;">To</span> Values.<span style="">Cells</span>.<span style="">Count</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">For</span> j = <span style="color: #202020;">1</span> <span style="color: #0000DD;">To</span> WorksheetFunction.<span style="">Sum</span><span style="color:#202020; ">&#40;</span>Counts.<span style="">Columns</span><span style="color:#202020; ">&#40;</span>i<span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Scores<span style="color:#202020; ">&#40;</span>k<span style="color:#202020; ">&#41;</span> = Values.<span style="">Cells</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">1</span>, i<span style="color:#202020; ">&#41;</span>.<span style="">Value</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k = k + <span style="color: #202020;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Next</span> j<br />
&nbsp; &nbsp; <span style="color: #0000DD;">Next</span> i<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; SDCOUNTS = WorksheetFunction.<span style="">StDevP</span><span style="color:#202020; ">&#40;</span>Scores<span style="color:#202020; ">&#41;</span></p>
<p><span style="color: #0000DD;">End</span> <span style="color: #0000DD;">Function</span></div>
</div>
</div>
<p></p>
<p>Cheers
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
